Documentation
¶
Index ¶
- Constants
- type Buffer
- type BufferPool
- type Config
- type Format
- type FormatConfig
- type SimpleLogger
- func (sl *SimpleLogger) Append(message []byte) (n int, err error)
- func (sl *SimpleLogger) Close() error
- func (sl *SimpleLogger) Debug(format string, args ...interface{})
- func (sl *SimpleLogger) Error(format string, args ...interface{})
- func (sl *SimpleLogger) Fatal(format string, args ...interface{})
- func (sl *SimpleLogger) Info(format string, args ...interface{})
- func (sl *SimpleLogger) Output(calldepth int, s string) (n int, err error)
- func (sl *SimpleLogger) SetLevel(level int)
- func (sl *SimpleLogger) Stack(err error) string
- func (sl *SimpleLogger) String(calldpeth int, level, message string) []byte
- func (sl *SimpleLogger) Warn(format string, args ...interface{})
- type Write
- type WriteConfig
Constants ¶
View Source
const ( DebugLevel int = iota InfoLevel WarnLevel ErrorLevel FatalLevel )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶ added in v0.2.0
type Buffer struct {
// contains filtered or unexported fields
}
func (*Buffer) AppendString ¶ added in v0.2.0
type BufferPool ¶ added in v0.2.0
type BufferPool struct {
// contains filtered or unexported fields
}
func NewBufferPool ¶ added in v0.2.0
func NewBufferPool() BufferPool
func (BufferPool) Get ¶ added in v0.2.0
func (bp BufferPool) Get() *Buffer
func (BufferPool) Put ¶ added in v0.2.0
func (bp BufferPool) Put(buf *Buffer)
type Config ¶
type Config struct { // 调用深度 Calldpeth int // 日志等级,>= 设置的等级才会写入 Level int // 格式化,配置 Format *FormatConfig Write *WriteConfig }
Config 日志配置信息
type Format ¶
type Format struct {
// contains filtered or unexported fields
}
func (*Format) GenMessage ¶
GenMessage 生成等待写入的内容
type FormatConfig ¶
FormatConfig
type SimpleLogger ¶
type SimpleLogger struct {
// contains filtered or unexported fields
}
SimpleLogger
func (*SimpleLogger) Append ¶ added in v0.2.0
func (sl *SimpleLogger) Append(message []byte) (n int, err error)
Append 写入文件
func (*SimpleLogger) Debug ¶
func (sl *SimpleLogger) Debug(format string, args ...interface{})
Debug
func (*SimpleLogger) Error ¶
func (sl *SimpleLogger) Error(format string, args ...interface{})
Error
func (*SimpleLogger) Fatal ¶
func (sl *SimpleLogger) Fatal(format string, args ...interface{})
Fatal 等级 退出程序
func (*SimpleLogger) Output ¶
func (sl *SimpleLogger) Output(calldepth int, s string) (n int, err error)
Output 系统输出
type WriteConfig ¶ added in v0.3.0
type WriteConfig struct { // 写入文件 Filename string // 单文件最大 bytes MaxSize int64 // 保留文件时间 MaxAge time.Duration // Gzip 压缩 Compress bool }
func DefaultWriteConfig ¶ added in v0.3.0
func DefaultWriteConfig() *WriteConfig
Click to show internal directories.
Click to hide internal directories.