Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultLoggerConfig = &LoggerConfig{ Level: "info", TextMode: true, Console: true, } )
Functions ¶
func SetIdGenFunc ¶
func SetIdGenFunc(f idGenFunc)
Types ¶
type LoggerConfig ¶
type LoggerConfig struct {
Level string `yaml:"level" json:"level"` // debug, info, warn, error, dpanic, panic, fatal
TextMode bool `yaml:"text_mode" json:"text_mode"` // 是否以文本格式输出日志,默认为json格式输出
Console bool `yaml:"console" json:"console"` // 是否输出到终端,在未指定日志文件名,默认输出到终端
Path string `yaml:"path" json:"path"` // 日志文件存放路径
MaxSize int `yaml:"max_size" json:"max_size"` // megabytes
MaxBackups int `yaml:"max_backups" json:"max_backups"` // 保留旧文件的最大个数
MaxAge int `yaml:"max_age" json:"max_age"` // 天数
Compress bool `yaml:"compress" json:"compress"` // 是否压缩/归档旧文件
}
Click to show internal directories.
Click to hide internal directories.