Documentation
¶
Index ¶
- func InArray(key ExtraKey, arr []ExtraKey) bool
- type CoreConfig
- type ExtraKey
- type Logger
- func (l *Logger) CtxDebugf(ctx context.Context, format string, v ...interface{})
- func (l *Logger) CtxErrorf(ctx context.Context, format string, v ...interface{})
- func (l *Logger) CtxFatalf(ctx context.Context, format string, v ...interface{})
- func (l *Logger) CtxInfof(ctx context.Context, format string, v ...interface{})
- func (l *Logger) CtxLogf(level hlog.Level, ctx context.Context, format string, kvs ...interface{})
- func (l *Logger) CtxNoticef(ctx context.Context, format string, v ...interface{})
- func (l *Logger) CtxTracef(ctx context.Context, format string, v ...interface{})
- func (l *Logger) CtxWarnf(ctx context.Context, format string, v ...interface{})
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) GetExtraKeys() []ExtraKey
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Log(level hlog.Level, kvs ...interface{})
- func (l *Logger) Logf(level hlog.Level, format string, kvs ...interface{})
- func (l *Logger) Logger() *zap.Logger
- func (l *Logger) Notice(v ...interface{})
- func (l *Logger) Noticef(format string, v ...interface{})
- func (l *Logger) PutExtraKeys(keys ...ExtraKey)
- func (l *Logger) SetLevel(level hlog.Level)
- func (l *Logger) SetOutput(writer io.Writer)
- func (l *Logger) Sync()
- func (l *Logger) Trace(v ...interface{})
- func (l *Logger) Tracef(format string, v ...interface{})
- func (l *Logger) Warn(v ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
- type Option
- func WithCoreEnc(enc zapcore.Encoder) Option
- func WithCoreLevel(lvl zap.AtomicLevel) Option
- func WithCoreWs(ws zapcore.WriteSyncer) Option
- func WithCores(coreConfigs ...CoreConfig) Option
- func WithExtraKeyAsStr() Option
- func WithExtraKeys(keys []ExtraKey) Option
- func WithZapOptions(opts ...zap.Option) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CoreConfig ¶
type CoreConfig struct { Enc zapcore.Encoder Ws zapcore.WriteSyncer Lvl zapcore.LevelEnabler }
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) CtxNoticef ¶
func (*Logger) GetExtraKeys ¶ added in v1.1.0
GetExtraKeys get extraKeys from logger config
func (*Logger) Logger ¶ added in v1.1.0
Logger is used to return an instance of *zap.Logger for custom fields, etc.
func (*Logger) PutExtraKeys ¶ added in v1.1.0
PutExtraKeys add extraKeys after init
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithExtraKeyAsStr ¶ added in v1.1.0
func WithExtraKeyAsStr() Option
WithExtraKeyAsStr convert extraKey to a string type when retrieving value from context Not recommended for use, only for compatibility with certain situations
For more information, refer to the documentation at `https://pkg.go.dev/context#WithValue`
func WithExtraKeys ¶ added in v1.1.0
WithExtraKeys allow you log extra values from context
func WithZapOptions ¶
WithZapOptions add origin zap option
Click to show internal directories.
Click to hide internal directories.