Documentation ¶
Index ¶
- Constants
- func Debug(msg ...interface{})
- func Debugf(format string, msg ...interface{})
- func Error(msg ...interface{})
- func Errorf(format string, msg ...interface{})
- func Info(msg ...interface{})
- func Infof(format string, msg ...interface{})
- func IsDebug() bool
- func SetLevel(level string)
- func SetLogConf(configFile string)
- func Warn(msg ...interface{})
- func Warnf(format string, msg ...interface{})
- type Config
- type LevelConfig
- type ShortConfig
Constants ¶
View Source
const ( LevelDebug = "debug" LevelInfo = "info" LevelError = "error" LevelWarn = "warn" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Logs []LevelConfig `json:"logs"` Level string `json:"level"` }
Config 完整配置
type LevelConfig ¶
type LevelConfig struct { Filename string `json:"logpath"` MaxSize int `json:"maxsize"` MaxBackups int `json:"backups"` MaxAge int `json:"maxage"` Compress bool `json:"compress"` Name string `json:"name"` //0默认为lumberjack,1 小时,2 分钟,3 天 Type int `json:"type"` //滚动时间,type=1 单位:小时,type=2 单位:分钟, type=3 单位:天 Rotation int `json:"rotation"` }
LevelConfig 日志配置结构体
Click to show internal directories.
Click to hide internal directories.