Documentation
¶
Index ¶
- func AutoLevel()
- func Debug(msg interface{}, fields ...Field)
- func Debugf(template string, args ...interface{})
- func Debugw(msg interface{}, keysAndValues ...interface{})
- func Error(msg interface{}, fields ...Field)
- func Errorf(template string, args ...interface{})
- func Errorw(msg interface{}, keysAndValues ...interface{})
- func Fatal(msg interface{}, fields ...Field)
- func Fatalf(template string, args ...interface{})
- func Fatalw(msg interface{}, keysAndValues ...interface{})
- func Flush() error
- func Info(msg interface{}, fields ...Field)
- func Infof(template string, args ...interface{})
- func Infow(msg interface{}, keysAndValues ...interface{})
- func Init(config *Config)
- func Panic(msg interface{}, fields ...Field)
- func Panicf(template string, args ...interface{})
- func Panicw(msg interface{}, keysAndValues ...interface{})
- func Warn(msg interface{}, fields ...Field)
- func Warnf(template string, args ...interface{})
- func Warnw(msg interface{}, keysAndValues ...interface{})
- type Config
- type Field
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { FileName string `json:"fileName" yaml:"fileName"` // 全路径文件名 DisableCaller bool `json:"disableCaller" yaml:"disableCaller"` // 是否添加调用者信息 MaxSize int `json:"maxSize" yaml:"maxSize"` // 日志输出文件最大长度,超过改值则截断 MaxAge int `json:"maxAge" yaml:"maxAge"` // 文件最多保存多少天 MaxBackup int `json:"maxBackup" yaml:"maxBackup"` // 日志文件最多保存多少个备份 CallerSkip int `json:"callerSkip" yaml:"callerSkip"` // CallerSkip Debug bool `json:"debug" yaml:"debug"` // 是否打印日志到控制台 Level string `json:"level" yaml:"level"` // 日志打印级别 Compress bool `json:"compress" yaml:"compress"` // 是否压缩 }
Config 日志配置
func DefaultConfig ¶
func DefaultConfig() Config
Click to show internal directories.
Click to hide internal directories.