Documentation ¶
Index ¶
- func NewZapLogger(out io.Writer, debug bool) *zap.Logger
- func RedirectStdLog(l *zap.Logger)
- type Field
- type Logger
- type NoopLoggerAdapter
- func (l *NoopLoggerAdapter) Debug(args ...any)
- func (l *NoopLoggerAdapter) Debugw(msg string, keysAndValues ...any)
- func (l *NoopLoggerAdapter) Error(args ...any)
- func (l *NoopLoggerAdapter) Errorw(msg string, keysAndValues ...any)
- func (l *NoopLoggerAdapter) Fatal(args ...any)
- func (l *NoopLoggerAdapter) Fatalw(msg string, keysAndValues ...any)
- func (l *NoopLoggerAdapter) Info(args ...any)
- func (l *NoopLoggerAdapter) Infow(msg string, keysAndValues ...any)
- func (l *NoopLoggerAdapter) Named(s string) Logger
- func (l *NoopLoggerAdapter) Warn(args ...any)
- func (l *NoopLoggerAdapter) Warnw(msg string, keysAndValues ...any)
- func (l *NoopLoggerAdapter) With(args ...any) Logger
- type ZapFieldAdapter
- type ZapLoggerAdapter
- func (l *ZapLoggerAdapter) Debug(args ...any)
- func (l *ZapLoggerAdapter) Debugw(msg string, keysAndValues ...any)
- func (l *ZapLoggerAdapter) Error(args ...any)
- func (l *ZapLoggerAdapter) Errorw(msg string, keysAndValues ...any)
- func (l *ZapLoggerAdapter) Fatal(args ...any)
- func (l *ZapLoggerAdapter) Fatalw(msg string, keysAndValues ...any)
- func (l *ZapLoggerAdapter) Info(args ...any)
- func (l *ZapLoggerAdapter) Infow(msg string, keysAndValues ...any)
- func (l *ZapLoggerAdapter) Named(s string) Logger
- func (l *ZapLoggerAdapter) Warn(args ...any)
- func (l *ZapLoggerAdapter) Warnw(msg string, keysAndValues ...any)
- func (l *ZapLoggerAdapter) With(args ...any) Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RedirectStdLog ¶
Types ¶
type Field ¶
type Field interface {
// contains filtered or unexported methods
}
Field can be used to pass strongly typed objects to the logger, like this: `logger.Infow("oops", log.Error(err))`
type Logger ¶
type Logger interface { Debug(args ...any) Debugw(msg string, keysAndValues ...any) Info(args ...any) Infow(msg string, keysAndValues ...any) Warn(args ...any) Warnw(msg string, keysAndValues ...any) Error(args ...any) Errorw(msg string, keysAndValues ...any) Fatal(args ...any) Fatalw(msg string, keysAndValues ...any) Named(s string) Logger With(args ...any) Logger }
type NoopLoggerAdapter ¶
type NoopLoggerAdapter struct { }
NoopLoggerAdapter implements Logger but does not do any logging
func (*NoopLoggerAdapter) Debug ¶
func (l *NoopLoggerAdapter) Debug(args ...any)
func (*NoopLoggerAdapter) Debugw ¶
func (l *NoopLoggerAdapter) Debugw(msg string, keysAndValues ...any)
func (*NoopLoggerAdapter) Error ¶
func (l *NoopLoggerAdapter) Error(args ...any)
func (*NoopLoggerAdapter) Errorw ¶
func (l *NoopLoggerAdapter) Errorw(msg string, keysAndValues ...any)
func (*NoopLoggerAdapter) Fatal ¶
func (l *NoopLoggerAdapter) Fatal(args ...any)
func (*NoopLoggerAdapter) Fatalw ¶
func (l *NoopLoggerAdapter) Fatalw(msg string, keysAndValues ...any)
func (*NoopLoggerAdapter) Info ¶
func (l *NoopLoggerAdapter) Info(args ...any)
func (*NoopLoggerAdapter) Infow ¶
func (l *NoopLoggerAdapter) Infow(msg string, keysAndValues ...any)
func (*NoopLoggerAdapter) Named ¶
func (l *NoopLoggerAdapter) Named(s string) Logger
func (*NoopLoggerAdapter) Warn ¶
func (l *NoopLoggerAdapter) Warn(args ...any)
func (*NoopLoggerAdapter) Warnw ¶
func (l *NoopLoggerAdapter) Warnw(msg string, keysAndValues ...any)
func (*NoopLoggerAdapter) With ¶
func (l *NoopLoggerAdapter) With(args ...any) Logger
type ZapFieldAdapter ¶
type ZapFieldAdapter struct {
// contains filtered or unexported fields
}
ZapFieldAdapter implements Field for zap.
type ZapLoggerAdapter ¶
type ZapLoggerAdapter struct {
// contains filtered or unexported fields
}
ZapLoggerAdapter implements Logger for zap. It seems somewhat complicated and verbose for wrapping a logger but I don't see how to to do it better in Go
func NewZapLoggerAdapter ¶
func NewZapLoggerAdapter( zl *zap.Logger, ) *ZapLoggerAdapter
func (*ZapLoggerAdapter) Debug ¶
func (l *ZapLoggerAdapter) Debug(args ...any)
func (*ZapLoggerAdapter) Debugw ¶
func (l *ZapLoggerAdapter) Debugw(msg string, keysAndValues ...any)
func (*ZapLoggerAdapter) Error ¶
func (l *ZapLoggerAdapter) Error(args ...any)
func (*ZapLoggerAdapter) Errorw ¶
func (l *ZapLoggerAdapter) Errorw(msg string, keysAndValues ...any)
func (*ZapLoggerAdapter) Fatal ¶
func (l *ZapLoggerAdapter) Fatal(args ...any)
func (*ZapLoggerAdapter) Fatalw ¶
func (l *ZapLoggerAdapter) Fatalw(msg string, keysAndValues ...any)
func (*ZapLoggerAdapter) Info ¶
func (l *ZapLoggerAdapter) Info(args ...any)
func (*ZapLoggerAdapter) Infow ¶
func (l *ZapLoggerAdapter) Infow(msg string, keysAndValues ...any)
func (*ZapLoggerAdapter) Named ¶
func (l *ZapLoggerAdapter) Named(s string) Logger
func (*ZapLoggerAdapter) Warn ¶
func (l *ZapLoggerAdapter) Warn(args ...any)
func (*ZapLoggerAdapter) Warnw ¶
func (l *ZapLoggerAdapter) Warnw(msg string, keysAndValues ...any)
func (*ZapLoggerAdapter) With ¶
func (l *ZapLoggerAdapter) With(args ...any) Logger
Click to show internal directories.
Click to hide internal directories.