Documentation ¶
Index ¶
- func DPanic(msg string, fields ...zap.Field)
- func Debug(msg string, fields ...zap.Field)
- func Error(msg string, fields ...zap.Field)
- func Fatal(msg string, fields ...zap.Field)
- func Info(msg string, fields ...zap.Field)
- func Init(filename, level string, maxSizeMB, maxAgeDay, maxBackups int, dev bool) *zap.Logger
- func Named(s string) *zap.Logger
- func NewDevLogger(filename, level string, maxSizeMB, maxAgeDay, maxBackups int) *zap.Logger
- func NewProdLogger(filename, level string, maxSizeMB, maxAgeDay, maxBackups int) *zap.Logger
- func Panic(msg string, fields ...zap.Field)
- func Sugar() *zap.SugaredLogger
- func Sync() error
- func Warn(msg string, fields ...zap.Field)
- func With(fields ...zap.Field) *zap.Logger
- func WithOptions(opts ...zap.Option) *zap.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDevLogger ¶
初始化开发模式的logger filename 可为空,为空则使用程序名为日志文件名 level 为"debug", "info", "warn", "error", "dpanic", "panic", "fatal" maxSizeMB 单个日志文件最大,单位为MB maxAgeDay 单个文件最多保留的天数 maxBackups 最多保留之前的几个日志文件
func NewProdLogger ¶
初始化生产模式的logger
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.