Documentation ¶
Index ¶
- Constants
- func NewDefaultWriter(option *DefaultWriterOption) io.Writer
- type DefaultWriter
- type DefaultWriterOption
- type Logger
- func (o *Logger) Log0Debug(v ...interface{})
- func (o *Logger) Log1Warn(v ...interface{})
- func (o *Logger) Log2Error(v ...interface{})
- func (o *Logger) Log3Fatal(v ...interface{})
- func (o *Logger) Log4Trace(v ...interface{})
- func (o *Logger) LogCalldepth(calldepth int, level int, msg ...interface{})
- func (o *Logger) SetColor(enable bool)
- func (o *Logger) SetFlags(flag int)
- func (o *Logger) SetLevel(level int)
- func (o *Logger) SetOutput(w io.Writer)
- func (o *Logger) SetPrefix(prefix string)
Constants ¶
View Source
const ( LoggerLevel0Debug = iota // 测试信息 绿色 LoggerLevel1Warning // 警告信息 黄色 LoggerLevel2Error // 错误信息 红色 LoggerLevel3Fatal // 严重信息 高亮红色 LoggerLevel4Trace // 打印信息 灰色 LoggerLevel5Off // 关闭信息 )
...
View Source
const ( ModeMonth = "month" // 按月压缩模式 ModeDay = "day" // 按日压缩模式 )
...
Variables ¶
This section is empty.
Functions ¶
func NewDefaultWriter ¶
func NewDefaultWriter(option *DefaultWriterOption) io.Writer
NewDefaultWriter ...
Types ¶
type DefaultWriter ¶
type DefaultWriter struct {
// contains filtered or unexported fields
}
DefaultWriter ...
type DefaultWriterOption ¶
type DefaultWriterOption struct { CompressMode string // 日志压缩模式 [month|day] month=按月压缩,day=按日压缩 CompressCount int // 仅在按日压缩模式下有效,设置为压缩几天前的日志,支持大于等于1的数字 CompressKeep int // 前多少次的压缩文件删除掉,支持month和day模式。默认为0,不删除。例如:1=保留最近1个压缩日志,2=保留最近2个压缩日志,依次类推。。。 Clone io.Writer // 日志克隆输出接口 Path string // 日志目录,默认目录:./log Label string // 日志标签 Name string // 日志文件名 }
DefaultWriterOption ...
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger ...
func (*Logger) LogCalldepth ¶
LogCalldepth ...
Click to show internal directories.
Click to hide internal directories.