Documentation
¶
Index ¶
- Constants
- func Debug(msg string, args ...any)
- func Debugc(ctx context.Context, msg string, args ...any)
- func Debugf(msg string, args ...any)
- func Error(msg string, args ...any)
- func Errorc(ctx context.Context, msg string, args ...any)
- func Errorf(msg string, args ...any)
- func Fatal(msg string, args ...any)
- func Fatalc(ctx context.Context, msg string, args ...any)
- func Fatalf(msg string, args ...any)
- func Info(msg string, args ...any)
- func Infoc(ctx context.Context, msg string, args ...any)
- func Infof(msg string, args ...any)
- func Warn(msg string, args ...any)
- func Warnc(ctx context.Context, msg string, args ...any)
- func Warnf(msg string, args ...any)
- type Log
- type Options
- type OutputFormatMode
- type OutputMode
Constants ¶
View Source
const ( DebugLevel = zapcore.DebugLevel InfoLevel = zapcore.InfoLevel WarnLevel = zapcore.WarnLevel ErrorLevel = zapcore.ErrorLevel FatalLevel = zapcore.FatalLevel )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Log ¶
type Log struct {
Logger *zap.SugaredLogger
Options *Options
}
type Options ¶
type Options struct {
Compress bool
File string // log file
Level zapcore.Level // log level
MaxAge int // retention days
MaxBackups int // MaxBackups is the maximum number of old log files to retain.
MaxSize int // MaxSize is the maximum size in megabytes of the log file before it gets rotated. File size in MB
OutputMode OutputMode
OutputFormatMode OutputFormatMode
}
type OutputFormatMode ¶
type OutputFormatMode uint
const ( OutputFormatModeText OutputFormatMode = iota OutputFormatModeJson )
type OutputMode ¶
type OutputMode uint
const ( OutputModeConsole OutputMode = iota OutputModeFile OutputModeConsoleAndFile )
Click to show internal directories.
Click to hide internal directories.