Documentation ¶
Index ¶
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func SetLevel(level Level)
- func SetLogger(config *Configuration)
- func TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- type Configuration
- type Level
- type LogFile
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TimeEncoder ¶
func TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
Types ¶
type Configuration ¶
type Configuration struct { Name string `xml:"name,omitempty" json:"name,omitempty"` // name: 日志名称,用于生成日志文件名等,比如 name = "app",则生成的日志文件为 app.log, app_error.log, app_debug.log Level Level `xml:"level,omitempty" json:"level,omitempty"` // level: 日志级别, 可选:DEBUG INFO WARN ERROR Path string `xml:"path,omitempty" json:"path,omitempty"` // path: 日志路径,比如 ./logs Count uint16 `xml:"count,omitempty" json:"count,omitempty"` // count: 日志文件数量 Size uint32 `xml:"size,omitempty" json:"size,omitempty"` // size: 日志文件大小, 单位KB }
日志配置
type LogFile ¶
func GetLogFile ¶
func GetLogFile() LogFile
type Logger ¶
type Logger interface { Debugf(format string, args ...interface{}) Debug(args ...interface{}) Infof(format string, args ...interface{}) Info(args ...interface{}) Warnf(format string, args ...interface{}) Warn(args ...interface{}) Errorf(format string, args ...interface{}) Error(args ...interface{}) Panicf(format string, args ...interface{}) Panic(args ...interface{}) Fatalf(format string, args ...interface{}) Fatal(args ...interface{}) SetLevel(level Level) GetLogFile() LogFile }
Logger 接口
Click to show internal directories.
Click to hide internal directories.