Documentation ¶
Overview ¶
Package spy provides an implementation of zap.Logger that helps test logging wrappers.
Index ¶
- func New() (*Logger, *Sink)
- type Log
- type Logger
- func (l *Logger) Check(lvl zap.Level, msg string) *zap.CheckedMessage
- func (l *Logger) DFatal(msg string, fields ...zap.Field)
- func (l *Logger) Debug(msg string, fields ...zap.Field)
- func (l *Logger) Error(msg string, fields ...zap.Field)
- func (l *Logger) Fatal(msg string, fields ...zap.Field)
- func (l *Logger) Info(msg string, fields ...zap.Field)
- func (l *Logger) Level() zap.Level
- func (l *Logger) Log(lvl zap.Level, msg string, fields ...zap.Field)
- func (l *Logger) Panic(msg string, fields ...zap.Field)
- func (l *Logger) SetDevelopment(dev bool)
- func (l *Logger) SetLevel(new zap.Level)
- func (l *Logger) StubTime()
- func (l *Logger) Warn(msg string, fields ...zap.Field)
- func (l *Logger) With(fields ...zap.Field) zap.Logger
- type Sink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
Logger satisfies zap.Logger, but makes testing convenient.
func (*Logger) Check ¶
Check returns a CheckedMessage if logging a particular message would succeed.
func (*Logger) DFatal ¶
DFatal logs at the Fatal level if the development flag is set, and the Fatal level otherwise.
func (*Logger) Fatal ¶
Fatal logs at the Fatal level. Note that the spy logger doesn't actuall call os.Exit.
func (*Logger) Panic ¶
Panic logs at the Panic level. Note that the spy Logger doesn't actually panic.
func (*Logger) SetDevelopment ¶
SetDevelopment sets the development flag.
func (*Logger) StubTime ¶
func (l *Logger) StubTime()
StubTime is a no-op, since the spy logger omits time entirely.
Click to show internal directories.
Click to hide internal directories.