Documentation ¶
Overview ¶
Package logur is an opinionated collection of logging best practices.
Check the readme for detailed documentation: https://github.com/logur/logur/blob/master/README.md
Also, check the example package for detailed examples: https://godoc.org/logur.dev/logur/examples
Index ¶
- func LogEventsEqual(expected LogEvent, actual LogEvent) errordeprecated
- func NewErrorStandardLogger(logger Logger, prefix string, flag int) *log.Logger
- func NewLevelWriter(logger Logger, level Level) *io.PipeWriter
- func NewStandardLogger(logger Logger, level Level, prefix string, flag int) *log.Logger
- func NewWriter(logger Logger) *io.PipeWriter
- type ContextExtractor
- type Fields
- type KVLogContextFunc
- type KVLogFunc
- type KVLogger
- type KVLoggerContext
- type KVLoggerFacade
- type Level
- type LevelEnabler
- type LogContextFunc
- type LogEvent
- type LogFunc
- type Logger
- func NewNoopLogger() Loggerdeprecated
- type LoggerContext
- type LoggerFacade
- type MessageLogger
- type NoopKVLogger
- func (NoopKVLogger) Debug(_ string, _ ...interface{})
- func (NoopKVLogger) DebugContext(_ context.Context, _ string, _ ...interface{})
- func (NoopKVLogger) Error(_ string, _ ...interface{})
- func (NoopKVLogger) ErrorContext(_ context.Context, _ string, _ ...interface{})
- func (NoopKVLogger) Info(_ string, _ ...interface{})
- func (NoopKVLogger) InfoContext(_ context.Context, _ string, _ ...interface{})
- func (NoopKVLogger) Trace(_ string, _ ...interface{})
- func (NoopKVLogger) TraceContext(_ context.Context, _ string, _ ...interface{})
- func (NoopKVLogger) Warn(_ string, _ ...interface{})
- func (NoopKVLogger) WarnContext(_ context.Context, _ string, _ ...interface{})
- type NoopLogger
- func (NoopLogger) Debug(_ string, _ ...map[string]interface{})
- func (NoopLogger) DebugContext(_ context.Context, _ string, _ ...map[string]interface{})
- func (NoopLogger) Error(_ string, _ ...map[string]interface{})
- func (NoopLogger) ErrorContext(_ context.Context, _ string, _ ...map[string]interface{})
- func (NoopLogger) Info(_ string, _ ...map[string]interface{})
- func (NoopLogger) InfoContext(_ context.Context, _ string, _ ...map[string]interface{})
- func (NoopLogger) Trace(_ string, _ ...map[string]interface{})
- func (NoopLogger) TraceContext(_ context.Context, _ string, _ ...map[string]interface{})
- func (NoopLogger) Warn(_ string, _ ...map[string]interface{})
- func (NoopLogger) WarnContext(_ context.Context, _ string, _ ...map[string]interface{})
- type PrintLogger
- type TestLogger
- func NewTestLogger() *TestLoggerdeprecated
- func (l *TestLogger) Count() int
- func (l *TestLogger) Debug(msg string, fields ...map[string]interface{})
- func (l *TestLogger) Error(msg string, fields ...map[string]interface{})
- func (l *TestLogger) Events() []LogEvent
- func (l *TestLogger) Info(msg string, fields ...map[string]interface{})
- func (l *TestLogger) LastEvent() *LogEvent
- func (l *TestLogger) Trace(msg string, fields ...map[string]interface{})
- func (l *TestLogger) Warn(msg string, fields ...map[string]interface{})
- type TestLoggerContext
- func (l *TestLoggerContext) Count() int
- func (l *TestLoggerContext) DebugContext(ctx context.Context, msg string, fields ...map[string]interface{})
- func (l *TestLoggerContext) ErrorContext(ctx context.Context, msg string, fields ...map[string]interface{})
- func (l *TestLoggerContext) Events() []LogEvent
- func (l *TestLoggerContext) InfoContext(ctx context.Context, msg string, fields ...map[string]interface{})
- func (l *TestLoggerContext) LastEvent() *LogEvent
- func (l *TestLoggerContext) TraceContext(ctx context.Context, msg string, fields ...map[string]interface{})
- func (l *TestLoggerContext) WarnContext(ctx context.Context, msg string, fields ...map[string]interface{})
- type TestLoggerFacade
- func (l *TestLoggerFacade) Count() int
- func (l *TestLoggerFacade) Debug(msg string, fields ...map[string]interface{})
- func (l *TestLoggerFacade) DebugContext(ctx context.Context, msg string, fields ...map[string]interface{})
- func (l *TestLoggerFacade) Error(msg string, fields ...map[string]interface{})
- func (l *TestLoggerFacade) ErrorContext(ctx context.Context, msg string, fields ...map[string]interface{})
- func (l *TestLoggerFacade) Events() []LogEvent
- func (l *TestLoggerFacade) Info(msg string, fields ...map[string]interface{})
- func (l *TestLoggerFacade) InfoContext(ctx context.Context, msg string, fields ...map[string]interface{})
- func (l *TestLoggerFacade) LastEvent() *LogEvent
- func (l *TestLoggerFacade) Trace(msg string, fields ...map[string]interface{})
- func (l *TestLoggerFacade) TraceContext(ctx context.Context, msg string, fields ...map[string]interface{})
- func (l *TestLoggerFacade) Warn(msg string, fields ...map[string]interface{})
- func (l *TestLoggerFacade) WarnContext(ctx context.Context, msg string, fields ...map[string]interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogEventsEqual
deprecated
func NewErrorStandardLogger ¶
NewErrorStandardLogger returns a new standard library logger for error level logging (eg. for HTTP servers).
func NewLevelWriter ¶
func NewLevelWriter(logger Logger, level Level) *io.PipeWriter
NewLevelWriter creates a new writer from a Logger for a specific level of log events.
func NewStandardLogger ¶
NewStandardLogger returns a new standard library logger.
func NewWriter ¶
func NewWriter(logger Logger) *io.PipeWriter
NewWriter creates a new writer from a Logger with a default Info level.
Types ¶
type ContextExtractor ¶ added in v0.16.0
ContextExtractor extracts a map of details from a context.
func ContextExtractors ¶ added in v0.16.0
func ContextExtractors(extractors ...ContextExtractor) ContextExtractor
ContextExtractors combines a list of ContextExtractor. The returned extractor aggregates the result of the underlying extractors.
type Fields ¶
type Fields map[string]interface{}
Fields is used to define structured fields which are appended to log events. It can be used as a shorthand for map[string]interface{}.
type KVLogContextFunc ¶ added in v0.17.0
KVLogContextFunc records a log event.
func KVLevelContextFunc ¶ added in v0.17.0
func KVLevelContextFunc(l KVLogger, level Level) KVLogContextFunc
KVLevelContextFunc returns a KVLogContextFunc for a level. If the level is invalid it falls back to Info level.
type KVLogFunc ¶ added in v0.17.0
type KVLogFunc func(msg string, keyvals ...interface{})
KVLogFunc records a log event.
func KVLevelFunc ¶ added in v0.17.0
KVLevelFunc returns a KVLogFunc for a level. If the level is invalid it falls back to Info level.
type KVLogger ¶ added in v0.17.0
type KVLogger interface { // Trace logs a Trace event. // // Even more fine-grained information than Debug events. // Loggers not supporting this level should fall back to Debug. Trace(msg string, keyvals ...interface{}) // Debug logs a Debug event. // // A verbose series of information events. // They are useful when debugging the system. Debug(msg string, keyvals ...interface{}) // Info logs an Info event. // // General information about what's happening inside the system. Info(msg string, keyvals ...interface{}) // Warn logs a Warn(ing) event. // // Non-critical events that should be looked at. Warn(msg string, keyvals ...interface{}) // Error logs an Error event. // // Critical events that require immediate attention. // Loggers commonly provide Fatal and Panic levels above Error level, // but exiting and panicing is out of scope for a logging library. Error(msg string, keyvals ...interface{}) }
KVLogger is a unified interface for various logging use cases and practices, including:
- leveled logging
- structured logging
Compared to Logger, KVLogger accepts key-value pairs in the form of variadic interface arguments.
type KVLoggerContext ¶ added in v0.17.0
type KVLoggerContext interface { // TraceContext logs a Trace event. // // Even more fine-grained information than Debug events. // Loggers not supporting this level should fall back to Debug. TraceContext(ctx context.Context, msg string, keyvals ...interface{}) // DebugContext logs a Debug event. // // A verbose series of information events. // They are useful when debugging the system. DebugContext(ctx context.Context, msg string, keyvals ...interface{}) // InfoContext logs an Info event. // // General information about what's happening inside the system. InfoContext(ctx context.Context, msg string, keyvals ...interface{}) // WarnContext logs a Warn(ing) event. // // Non-critical events that should be looked at. WarnContext(ctx context.Context, msg string, keyvals ...interface{}) // ErrorContext logs an Error event. // // Critical events that require immediate attention. // Loggers commonly provide Fatal and Panic levels above Error level, // but exiting and panicing is out of scope for a logging library. ErrorContext(ctx context.Context, msg string, keyvals ...interface{}) }
KVLoggerContext is an optional interface that MAY be implemented by a KVLogger. It is similar to KVLogger, but it receives a context as the first parameter. An implementation MAY extract information from the context and annotate the log context with it.
KVLoggerContext MAY honor the deadline carried by the context, but that's not a hard requirement.
type KVLoggerFacade ¶ added in v0.17.0
type KVLoggerFacade interface { KVLogger KVLoggerContext }
KVLoggerFacade is a combination of KVLogger and KVLoggerContext. It's sole purpose is to make the API of the package concise by exposing a common interface type for returned loggers. It's not supposed to be used by consumers of this package.
It goes directly against the "Use interfaces, return structs" idiom of Go, but at the current phase of the package the smaller API surface makes more sense.
In the future it might get replaced with concrete types.
func LoggerToKV ¶ added in v0.17.0
func LoggerToKV(logger Logger) KVLoggerFacade
LoggerToKV converts a Logger to a KVLogger.
type Level ¶
type Level uint32
Level represents the same levels as defined in Logger.
const ( // Even more fine-grained information than Debug events. // Loggers not supporting this level should fall back to Debug. Trace Level = iota // A verbose series of information events. // They are useful when debugging the system. Debug // General information about what's happening inside the system. Info // Non-critical events that should be looked at. Warn // Critical events that require immediate attention. Error )
Levels as defined in Logger.
func Levels ¶ added in v0.17.0
func Levels() []Level
Levels returns a list of available Level values.
func ParseLevel ¶
ParseLevel takes a string level and returns the defined log level constant. If the level is not defined, it returns false as the second parameter.
func (*Level) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type LevelEnabler ¶
type LevelEnabler interface { // LevelEnabled checks if a level is enabled in a logger. LevelEnabled(level Level) bool }
LevelEnabler checks if a level is enabled in a logger. If the logger cannot reliably decide the correct level this method MUST return true.
type LogContextFunc ¶ added in v0.16.0
LogContextFunc records a log event.
func LevelContextFunc ¶ added in v0.17.0
func LevelContextFunc(l Logger, level Level) LogContextFunc
LevelContextFunc returns a LogContextFunc for a level. If the level is invalid it falls back to Info level.
type LogEvent ¶
LogEvent represents a single log event recorded by a test logger.
func (LogEvent) AssertEquals ¶ added in v0.16.0
AssertEquals checks if two LogEvent instances are equal and returns an error if not.
type Logger ¶
type Logger interface { // Trace logs a Trace event. // // Even more fine-grained information than Debug events. // Loggers not supporting this level should fall back to Debug. Trace(msg string, fields ...map[string]interface{}) // Debug logs a Debug event. // // A verbose series of information events. // They are useful when debugging the system. Debug(msg string, fields ...map[string]interface{}) // Info logs an Info event. // // General information about what's happening inside the system. Info(msg string, fields ...map[string]interface{}) // Warn logs a Warn(ing) event. // // Non-critical events that should be looked at. Warn(msg string, fields ...map[string]interface{}) // Error logs an Error event. // // Critical events that require immediate attention. // Loggers commonly provide Fatal and Panic levels above Error level, // but exiting and panicing is out of scope for a logging library. Error(msg string, fields ...map[string]interface{}) }
Logger is a unified interface for various logging use cases and practices, including:
- leveled logging
- structured logging
func NewNoopLogger
deprecated
func NewNoopLogger() Logger
NewNoopLogger creates a no-op logger that discards all received log events. Useful in examples and as a fallback logger.
Deprecated: use NoopLogger.
type LoggerContext ¶ added in v0.16.0
type LoggerContext interface { // TraceContext logs a Trace event. // // Even more fine-grained information than Debug events. // Loggers not supporting this level should fall back to Debug. TraceContext(ctx context.Context, msg string, fields ...map[string]interface{}) // DebugContext logs a Debug event. // // A verbose series of information events. // They are useful when debugging the system. DebugContext(ctx context.Context, msg string, fields ...map[string]interface{}) // InfoContext logs an Info event. // // General information about what's happening inside the system. InfoContext(ctx context.Context, msg string, fields ...map[string]interface{}) // WarnContext logs a Warn(ing) event. // // Non-critical events that should be looked at. WarnContext(ctx context.Context, msg string, fields ...map[string]interface{}) // ErrorContext logs an Error event. // // Critical events that require immediate attention. // Loggers commonly provide Fatal and Panic levels above Error level, // but exiting and panicing is out of scope for a logging library. ErrorContext(ctx context.Context, msg string, fields ...map[string]interface{}) }
LoggerContext is an optional interface that MAY be implemented by a Logger. It is similar to Logger, but it receives a context as the first parameter. An implementation MAY extract information from the context and annotate the log context with it.
LoggerContext MAY honor the deadline carried by the context, but that's not a hard requirement.
type LoggerFacade ¶ added in v0.16.0
type LoggerFacade interface { Logger LoggerContext }
LoggerFacade is a combination of Logger and LoggerContext. It's sole purpose is to make the API of the package concise by exposing a common interface type for returned loggers. It's not supposed to be used by consumers of this package.
It goes directly against the "Use interfaces, return structs" idiom of Go, but at the current phase of the package the smaller API surface makes more sense.
In the future it might get replaced with concrete types.
func WithContextExtractor ¶ added in v0.16.0
func WithContextExtractor(logger Logger, extractor ContextExtractor) LoggerFacade
WithContextExtractor returns a logger that extracts details from the provided context (if any) and annotates the log event with them.
func WithField ¶ added in v0.15.1
func WithField(logger Logger, key string, value interface{}) LoggerFacade
WithField is a shortcut for WithFields(logger, map[string]interface{}{key: value}).
func WithFields ¶
func WithFields(logger Logger, fields map[string]interface{}) LoggerFacade
WithFields returns a new logger instance that attaches the given fields to every subsequent log call.
type MessageLogger ¶
type MessageLogger struct {
// contains filtered or unexported fields
}
MessageLogger simplifies the Logger interface by removing the second context parameter. Useful when there is no need for contextual logging.
func NewMessageLogger ¶
func NewMessageLogger(logger Logger) *MessageLogger
NewMessageLogger returns a new MessageLogger instance.
func (*MessageLogger) Debug ¶
func (l *MessageLogger) Debug(msg string)
Debug logs a Debug level event.
func (*MessageLogger) Error ¶
func (l *MessageLogger) Error(msg string)
Error logs a Error level event.
func (*MessageLogger) Trace ¶
func (l *MessageLogger) Trace(msg string)
Trace logs a Trace level event.
type NoopKVLogger ¶ added in v0.17.0
type NoopKVLogger struct{}
NoopKVLogger is a no-op logger that discards all received log events.
It implements both KVLogger and KVLoggerContext interfaces.
func (NoopKVLogger) Debug ¶ added in v0.17.0
func (NoopKVLogger) Debug(_ string, _ ...interface{})
func (NoopKVLogger) DebugContext ¶ added in v0.17.0
func (NoopKVLogger) DebugContext(_ context.Context, _ string, _ ...interface{})
func (NoopKVLogger) Error ¶ added in v0.17.0
func (NoopKVLogger) Error(_ string, _ ...interface{})
func (NoopKVLogger) ErrorContext ¶ added in v0.17.0
func (NoopKVLogger) ErrorContext(_ context.Context, _ string, _ ...interface{})
func (NoopKVLogger) Info ¶ added in v0.17.0
func (NoopKVLogger) Info(_ string, _ ...interface{})
func (NoopKVLogger) InfoContext ¶ added in v0.17.0
func (NoopKVLogger) InfoContext(_ context.Context, _ string, _ ...interface{})
func (NoopKVLogger) Trace ¶ added in v0.17.0
func (NoopKVLogger) Trace(_ string, _ ...interface{})
func (NoopKVLogger) TraceContext ¶ added in v0.17.0
func (NoopKVLogger) TraceContext(_ context.Context, _ string, _ ...interface{})
func (NoopKVLogger) Warn ¶ added in v0.17.0
func (NoopKVLogger) Warn(_ string, _ ...interface{})
func (NoopKVLogger) WarnContext ¶ added in v0.17.0
func (NoopKVLogger) WarnContext(_ context.Context, _ string, _ ...interface{})
type NoopLogger ¶ added in v0.16.0
type NoopLogger struct{}
NoopLogger is a no-op logger that discards all received log events.
It implements both Logger and LoggerContext interfaces.
func (NoopLogger) Debug ¶ added in v0.16.0
func (NoopLogger) Debug(_ string, _ ...map[string]interface{})
func (NoopLogger) DebugContext ¶ added in v0.16.0
func (NoopLogger) DebugContext(_ context.Context, _ string, _ ...map[string]interface{})
func (NoopLogger) Error ¶ added in v0.16.0
func (NoopLogger) Error(_ string, _ ...map[string]interface{})
func (NoopLogger) ErrorContext ¶ added in v0.16.0
func (NoopLogger) ErrorContext(_ context.Context, _ string, _ ...map[string]interface{})
func (NoopLogger) Info ¶ added in v0.16.0
func (NoopLogger) Info(_ string, _ ...map[string]interface{})
func (NoopLogger) InfoContext ¶ added in v0.16.0
func (NoopLogger) InfoContext(_ context.Context, _ string, _ ...map[string]interface{})
func (NoopLogger) Trace ¶ added in v0.16.0
func (NoopLogger) Trace(_ string, _ ...map[string]interface{})
func (NoopLogger) TraceContext ¶ added in v0.16.0
func (NoopLogger) TraceContext(_ context.Context, _ string, _ ...map[string]interface{})
func (NoopLogger) Warn ¶ added in v0.16.0
func (NoopLogger) Warn(_ string, _ ...map[string]interface{})
func (NoopLogger) WarnContext ¶ added in v0.16.0
func (NoopLogger) WarnContext(_ context.Context, _ string, _ ...map[string]interface{})
type PrintLogger ¶
type PrintLogger struct {
// contains filtered or unexported fields
}
PrintLogger logs messages with fmt.Print* function semantics.
func NewErrorPrintLogger ¶
func NewErrorPrintLogger(logger Logger) *PrintLogger
NewErrorPrintLogger returns a new PrintLogger that logs everything on error level.
func NewPrintLogger ¶
func NewPrintLogger(logger LogFunc) *PrintLogger
NewPrintLogger returns a new PrintLogger.
func (*PrintLogger) Print ¶
func (l *PrintLogger) Print(v ...interface{})
Print logs a line with fmt.Print semantics.
func (*PrintLogger) Printf ¶
func (l *PrintLogger) Printf(format string, args ...interface{})
Printf logs a line with fmt.Printf semantics.
func (*PrintLogger) Println ¶
func (l *PrintLogger) Println(v ...interface{})
Println logs a line with fmt.Println semantics.
type TestLogger ¶
type TestLogger struct {
// contains filtered or unexported fields
}
TestLogger is a Logger recording every log event.
Useful when you want to test behavior with an Logger, but not with LoggerContext. In every other cases TestLoggerFacade should be the default choice of test logger.
The TestLogger is safe for concurrent use.
func NewTestLogger
deprecated
func NewTestLogger() *TestLogger
NewTestLogger returns a new TestLogger.
Deprecated: use TestLogger.
func (*TestLogger) Count ¶
func (l *TestLogger) Count() int
Count returns the number of events recorded in the logger.
func (*TestLogger) Debug ¶
func (l *TestLogger) Debug(msg string, fields ...map[string]interface{})
Debug records a Debug level event.
func (*TestLogger) Error ¶
func (l *TestLogger) Error(msg string, fields ...map[string]interface{})
Error records an Error level event.
func (*TestLogger) Events ¶
func (l *TestLogger) Events() []LogEvent
Events returns all recorded events in the logger.
func (*TestLogger) Info ¶
func (l *TestLogger) Info(msg string, fields ...map[string]interface{})
Info records an Info level event.
func (*TestLogger) LastEvent ¶
func (l *TestLogger) LastEvent() *LogEvent
LastEvent returns the last recorded event in the logger (if any).
func (*TestLogger) Trace ¶
func (l *TestLogger) Trace(msg string, fields ...map[string]interface{})
Trace records a Trace level event.
func (*TestLogger) Warn ¶
func (l *TestLogger) Warn(msg string, fields ...map[string]interface{})
Warn records a Warn level event.
type TestLoggerContext ¶ added in v0.16.0
type TestLoggerContext struct {
// contains filtered or unexported fields
}
TestLoggerContext is a LoggerContext recording every log event.
Useful when you want to test behavior with an LoggerContext, but not with Logger. In every other cases TestLoggerFacade should be the default choice of test logger.
The TestLoggerContext is safe for concurrent use.
func (*TestLoggerContext) Count ¶ added in v0.16.0
func (l *TestLoggerContext) Count() int
Count returns the number of events recorded in the logger.
func (*TestLoggerContext) DebugContext ¶ added in v0.16.0
func (l *TestLoggerContext) DebugContext(ctx context.Context, msg string, fields ...map[string]interface{})
DebugContext records a Debug level event.
func (*TestLoggerContext) ErrorContext ¶ added in v0.16.0
func (l *TestLoggerContext) ErrorContext(ctx context.Context, msg string, fields ...map[string]interface{})
ErrorContext records an Error level event.
func (*TestLoggerContext) Events ¶ added in v0.16.0
func (l *TestLoggerContext) Events() []LogEvent
Events returns all recorded events in the logger.
func (*TestLoggerContext) InfoContext ¶ added in v0.16.0
func (l *TestLoggerContext) InfoContext(ctx context.Context, msg string, fields ...map[string]interface{})
InfoContext records an Info level event.
func (*TestLoggerContext) LastEvent ¶ added in v0.16.0
func (l *TestLoggerContext) LastEvent() *LogEvent
LastEvent returns the last recorded event in the logger (if any).
func (*TestLoggerContext) TraceContext ¶ added in v0.16.0
func (l *TestLoggerContext) TraceContext(ctx context.Context, msg string, fields ...map[string]interface{})
TraceContext records a Trace level event.
func (*TestLoggerContext) WarnContext ¶ added in v0.16.0
func (l *TestLoggerContext) WarnContext(ctx context.Context, msg string, fields ...map[string]interface{})
WarnContext records a Warn level event.
type TestLoggerFacade ¶ added in v0.16.0
type TestLoggerFacade struct {
// contains filtered or unexported fields
}
TestLoggerFacade is a LoggerFacade recording every log event.
The TestLoggerFacade is safe for concurrent use.
func (*TestLoggerFacade) Count ¶ added in v0.16.0
func (l *TestLoggerFacade) Count() int
Count returns the number of events recorded in the logger.
func (*TestLoggerFacade) Debug ¶ added in v0.16.0
func (l *TestLoggerFacade) Debug(msg string, fields ...map[string]interface{})
Debug records a Debug level event.
func (*TestLoggerFacade) DebugContext ¶ added in v0.16.0
func (l *TestLoggerFacade) DebugContext(ctx context.Context, msg string, fields ...map[string]interface{})
DebugContext records a Debug level event.
func (*TestLoggerFacade) Error ¶ added in v0.16.0
func (l *TestLoggerFacade) Error(msg string, fields ...map[string]interface{})
Error records an Error level event.
func (*TestLoggerFacade) ErrorContext ¶ added in v0.16.0
func (l *TestLoggerFacade) ErrorContext(ctx context.Context, msg string, fields ...map[string]interface{})
ErrorContext records an Error level event.
func (*TestLoggerFacade) Events ¶ added in v0.16.0
func (l *TestLoggerFacade) Events() []LogEvent
Events returns all recorded events in the logger.
func (*TestLoggerFacade) Info ¶ added in v0.16.0
func (l *TestLoggerFacade) Info(msg string, fields ...map[string]interface{})
Info records an Info level event.
func (*TestLoggerFacade) InfoContext ¶ added in v0.16.0
func (l *TestLoggerFacade) InfoContext(ctx context.Context, msg string, fields ...map[string]interface{})
InfoContext records an Info level event.
func (*TestLoggerFacade) LastEvent ¶ added in v0.16.0
func (l *TestLoggerFacade) LastEvent() *LogEvent
LastEvent returns the last recorded event in the logger (if any).
func (*TestLoggerFacade) Trace ¶ added in v0.16.0
func (l *TestLoggerFacade) Trace(msg string, fields ...map[string]interface{})
Trace records a Trace level event.
func (*TestLoggerFacade) TraceContext ¶ added in v0.16.0
func (l *TestLoggerFacade) TraceContext(ctx context.Context, msg string, fields ...map[string]interface{})
TraceContext records a Trace level event.
func (*TestLoggerFacade) Warn ¶ added in v0.16.0
func (l *TestLoggerFacade) Warn(msg string, fields ...map[string]interface{})
Warn records a Warn level event.
func (*TestLoggerFacade) WarnContext ¶ added in v0.16.0
func (l *TestLoggerFacade) WarnContext(ctx context.Context, msg string, fields ...map[string]interface{})
WarnContext records a Warn level event.