Documentation
¶
Index ¶
- Constants
- func Any(key string, val interface{}) zap.Field
- func Bool(key string, val bool) zap.Field
- func Debug(msg string, fields ...zap.Field)
- func Debugf(format string, args ...interface{})
- func Err(err error) zap.Field
- func Error(msg string, fields ...zap.Field)
- func Errorf(format string, args ...interface{})
- func Fatal(msg string, fields ...zap.Field)
- func Fatalf(format string, args ...interface{})
- func Float64(key string, val float64) zap.Field
- func Info(msg string, fields ...zap.Field)
- func Infof(format string, args ...interface{})
- func Init(opts *Options)
- func Int(key string, val int) zap.Field
- func Int64(key string, val int64) zap.Field
- func String(key, val string) zap.Field
- func Sync() error
- func Warn(msg string, fields ...zap.Field)
- func Warnf(format string, args ...interface{})
- type Level
- type Logger
- type Options
Constants ¶
View Source
const ( DebugLevel = zapcore.DebugLevel InfoLevel = zapcore.InfoLevel WarnLevel = zapcore.WarnLevel ErrorLevel = zapcore.ErrorLevel PanicLevel = zapcore.PanicLevel FatalLevel = zapcore.FatalLevel )
日志级别常量
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface {
Debug(msg string, fields ...zap.Field)
Info(msg string, fields ...zap.Field)
Warn(msg string, fields ...zap.Field)
Error(msg string, fields ...zap.Field)
Fatal(msg string, fields ...zap.Field)
With(fields ...zap.Field) Logger
Sugar() *zap.SugaredLogger
Sync() error
}
Logger 日志接口
type Options ¶
type Options struct {
Level string `json:"level" mapstructure:"level"`
Format string `json:"format" mapstructure:"format"`
OutputPaths []string `json:"output-paths" mapstructure:"output-paths"`
Development bool `json:"development" mapstructure:"development"`
EnableColor bool `json:"enable-color" mapstructure:"enable-color"`
}
Options 日志配置选项
Click to show internal directories.
Click to hide internal directories.