Documentation
¶
Index ¶
- Constants
- func CtxDebugw(ctx context.Context, msg string, keysAndValues ...interface{})
- func CtxErrorw(ctx context.Context, msg string, keysAndValues ...interface{})
- func CtxFatalw(ctx context.Context, msg string, keysAndValues ...interface{})
- func CtxInfow(ctx context.Context, msg string, keysAndValues ...interface{})
- func CtxPanicw(ctx context.Context, msg string, keysAndValues ...interface{})
- func CtxWarnw(ctx context.Context, msg string, keysAndValues ...interface{})
- func Debugw(msg string, keysAndValues ...interface{})
- func Errorw(msg string, keysAndValues ...interface{})
- func Fatalw(msg string, keysAndValues ...interface{})
- func GetZapLogger() *zap.Logger
- func Infow(msg string, keysAndValues ...interface{})
- func Panicw(msg string, keysAndValues ...interface{})
- func RegisterLogger(options *Options)
- func Sync()
- func Warnw(msg string, keysAndValues ...interface{})
- type Logger
- type Options
Constants ¶
View Source
const ( EncoderConsole = "console" EncoderJson = "json" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface {
Debugw(msg string, keysAndValues ...interface{})
Infow(msg string, keysAndValues ...interface{})
Warnw(msg string, keysAndValues ...interface{})
Errorw(msg string, keysAndValues ...interface{})
Panicw(msg string, keysAndValues ...interface{})
Fatalw(msg string, keysAndValues ...interface{})
CtxDebugw(ctx context.Context, template string, args ...interface{})
CtxInfow(ctx context.Context, template string, args ...interface{})
CtxWarnw(ctx context.Context, template string, args ...interface{})
CtxErrorw(ctx context.Context, template string, args ...interface{})
CtxPanicw(ctx context.Context, template string, args ...interface{})
CtxFatalw(ctx context.Context, template string, args ...interface{})
Sync()
}
Logger ...
type Options ¶
type Options struct {
Level string `mapstructure:"level"`
OutputPath string `mapstructure:"output-path,omitempty"`
EncoderType string `mapstructure:"encoder-type,omitempty"`
MaxSize int `mapstructure:"max-size,omitempty"`
MaxBackups int `mapstructure:"max-backups,omitempty"`
MaxAge int `mapstructure:"max-age,omitempty"`
Compress bool `mapstructure:"compress,omitempty"`
MessageKey string `mapstructure:"message-key,omitempty"`
LevelKey string `mapstructure:"level-key,omitempty"`
CallerKey string `mapstructure:"caller-key,omitempty"`
TimeKey string `mapstructure:"time-key,omitempty"`
ExtraKeys []string `mapstructure:"extra-keys,omitempty"`
}
Options ...
Click to show internal directories.
Click to hide internal directories.