Documentation ¶
Index ¶
- Constants
- func Debug(msg string, fields ...zapcore.Field)
- func Debugf(msg string, args ...interface{})
- func Error(msg string, fields ...zapcore.Field)
- func Errorf(msg string, args ...interface{})
- func Fatal(msg string, fields ...zapcore.Field)
- func Fatalf(msg string, args ...interface{})
- func Info(msg string, fields ...zapcore.Field)
- func Infof(msg string, args ...interface{})
- func InitLog(cfg Logger) error
- func Panic(msg string, fields ...zapcore.Field)
- func Panicf(msg string, args ...interface{})
- func Trace(msg string, fields ...zapcore.Field)
- func Tracef(msg string, args ...interface{})
- func Warn(msg string, fields ...zapcore.Field)
- func Warnf(msg string, args ...interface{})
- type Logger
Constants ¶
View Source
const ( // DefaultPath 默认文件名称 DefaultPath = "./xlog.log" // TraceName 日志级别:TRACE TraceName = "TRACE" // DebugName 日志级别:DEBUG DebugName = "DEBUG" // InfoName 日志级别:INFO InfoName = "INFO" // WarnName 日志级别:WARN WarnName = "WARN" // ErrorName 日志级别:ERROR ErrorName = "ERROR" // PanicName 日志级别:PANIC PanicName = "PANIC" // FatalName 日志级别:FATAL FatalName = "FATAL" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct { Level string `json:"level" yaml:"level"` FileName string `json:"filename" yaml:"filename"` // 文件位置 MaxSize int `json:"maxsize" yaml:"maxsize"` // 日志文件最大大小 MaxAge int `json:"maxage" yaml:"maxage"` // 最大存储天数 MaxBackups int `json:"maxbackups" yaml:"maxbackups"` // 最大备份数 LocalTime bool `json:"localtime" yaml:"localtime"` // 用于格式化时间戳的时间是否在 Compress bool `json:"compress" yaml:"compress"` // 是否压缩 }
Click to show internal directories.
Click to hide internal directories.