Documentation ¶
Index ¶
- func NewReplayLogger(logger log.Logger, isReplay *bool, enableLoggingInReplay *bool) log.Logger
- type DefaultLogger
- func (l *DefaultLogger) Debug(msg string, keyvals ...interface{})
- func (l *DefaultLogger) Error(msg string, keyvals ...interface{})
- func (l *DefaultLogger) Info(msg string, keyvals ...interface{})
- func (l *DefaultLogger) Warn(msg string, keyvals ...interface{})
- func (l *DefaultLogger) With(keyvals ...interface{}) log.Logger
- type MemoryLogger
- type MemoryLoggerWithoutWith
- func (l *MemoryLoggerWithoutWith) Debug(msg string, keyvals ...interface{})
- func (l *MemoryLoggerWithoutWith) Error(msg string, keyvals ...interface{})
- func (l *MemoryLoggerWithoutWith) Info(msg string, keyvals ...interface{})
- func (l *MemoryLoggerWithoutWith) Lines() []string
- func (l *MemoryLoggerWithoutWith) Warn(msg string, keyvals ...interface{})
- type NoopLogger
- type ReplayLogger
- func (l *ReplayLogger) Debug(msg string, keyvals ...interface{})
- func (l *ReplayLogger) Error(msg string, keyvals ...interface{})
- func (l *ReplayLogger) Info(msg string, keyvals ...interface{})
- func (l *ReplayLogger) Warn(msg string, keyvals ...interface{})
- func (l *ReplayLogger) With(keyvals ...interface{}) log.Logger
- func (l *ReplayLogger) WithCallerSkip(depth int) log.Logger
- type TestReporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
DefaultLogger is Logger implementation on top of standard log.Logger. It is used if logger is not specified.
func NewDefaultLogger ¶
func NewDefaultLogger() *DefaultLogger
NewDefaultLogger creates new instance of DefaultLogger.
func (*DefaultLogger) Debug ¶
func (l *DefaultLogger) Debug(msg string, keyvals ...interface{})
Debug writes message to the log.
func (*DefaultLogger) Error ¶
func (l *DefaultLogger) Error(msg string, keyvals ...interface{})
Error writes message to the log.
func (*DefaultLogger) Info ¶
func (l *DefaultLogger) Info(msg string, keyvals ...interface{})
Info writes message to the log.
func (*DefaultLogger) Warn ¶
func (l *DefaultLogger) Warn(msg string, keyvals ...interface{})
Warn writes message to the log.
func (*DefaultLogger) With ¶
func (l *DefaultLogger) With(keyvals ...interface{}) log.Logger
With returns new logger the prepend every log entry with keyvals.
type MemoryLogger ¶
type MemoryLogger struct {
*MemoryLoggerWithoutWith
}
func NewMemoryLogger ¶
func NewMemoryLogger() *MemoryLogger
NewMemoryLogger creates new instance of MemoryLogger.
func (*MemoryLogger) With ¶
func (l *MemoryLogger) With(keyvals ...interface{}) log.Logger
With returns new logger that prepend every log entry with keyvals.
type MemoryLoggerWithoutWith ¶ added in v1.25.1
type MemoryLoggerWithoutWith struct {
// contains filtered or unexported fields
}
MemoryLoggerWithoutWith is a Logger implementation that stores logs in memory (useful for testing). Use Lines() to get log lines.
func NewMemoryLoggerWithoutWith ¶ added in v1.25.1
func NewMemoryLoggerWithoutWith() *MemoryLoggerWithoutWith
NewMemoryLoggerWithoutWith creates new instance of MemoryLoggerWithoutWith.
func (*MemoryLoggerWithoutWith) Debug ¶ added in v1.25.1
func (l *MemoryLoggerWithoutWith) Debug(msg string, keyvals ...interface{})
Debug appends message to the log.
func (*MemoryLoggerWithoutWith) Error ¶ added in v1.25.1
func (l *MemoryLoggerWithoutWith) Error(msg string, keyvals ...interface{})
Error appends message to the log.
func (*MemoryLoggerWithoutWith) Info ¶ added in v1.25.1
func (l *MemoryLoggerWithoutWith) Info(msg string, keyvals ...interface{})
Info appends message to the log.
func (*MemoryLoggerWithoutWith) Lines ¶ added in v1.25.1
func (l *MemoryLoggerWithoutWith) Lines() []string
Lines returns written log lines.
func (*MemoryLoggerWithoutWith) Warn ¶ added in v1.25.1
func (l *MemoryLoggerWithoutWith) Warn(msg string, keyvals ...interface{})
Warn appends message to the log.
type NoopLogger ¶ added in v1.6.0
type NoopLogger struct { }
NoopLogger is Logger implementation that doesn't produce any logs.
func NewNopLogger ¶
func NewNopLogger() *NoopLogger
NewNopLogger creates new instance of NoopLogger.
func (*NoopLogger) Debug ¶ added in v1.6.0
func (l *NoopLogger) Debug(string, ...interface{})
Debug does nothing.
func (*NoopLogger) Error ¶ added in v1.6.0
func (l *NoopLogger) Error(string, ...interface{})
Error does nothing.
func (*NoopLogger) Info ¶ added in v1.6.0
func (l *NoopLogger) Info(string, ...interface{})
Info does nothing.
func (*NoopLogger) Warn ¶ added in v1.6.0
func (l *NoopLogger) Warn(string, ...interface{})
Warn does nothing.
func (*NoopLogger) With ¶ added in v1.6.0
func (l *NoopLogger) With(...interface{}) log.Logger
With returns new NoopLogger.
type ReplayLogger ¶
type ReplayLogger struct {
// contains filtered or unexported fields
}
ReplayLogger is Logger implementation that is aware of replay.
func (*ReplayLogger) Debug ¶
func (l *ReplayLogger) Debug(msg string, keyvals ...interface{})
Debug writes message to the log if it is not a replay.
func (*ReplayLogger) Error ¶
func (l *ReplayLogger) Error(msg string, keyvals ...interface{})
Error writes message to the log if it is not a replay.
func (*ReplayLogger) Info ¶
func (l *ReplayLogger) Info(msg string, keyvals ...interface{})
Info writes message to the log if it is not a replay.
func (*ReplayLogger) Warn ¶
func (l *ReplayLogger) Warn(msg string, keyvals ...interface{})
Warn writes message to the log if it is not a replay.
func (*ReplayLogger) With ¶
func (l *ReplayLogger) With(keyvals ...interface{}) log.Logger
With returns new logger that prepend every log entry with keyvals.
func (*ReplayLogger) WithCallerSkip ¶ added in v1.25.0
func (l *ReplayLogger) WithCallerSkip(depth int) log.Logger
type TestReporter ¶
type TestReporter struct {
// contains filtered or unexported fields
}
TestReporter is a log adapter for gomock.
func NewTestReporter ¶
func NewTestReporter(logger log.Logger) *TestReporter
NewTestReporter creates new instance of TestReporter.
func (*TestReporter) Errorf ¶
func (t *TestReporter) Errorf(format string, args ...interface{})
Errorf writes error to the log.
func (*TestReporter) Fatalf ¶
func (t *TestReporter) Fatalf(format string, args ...interface{})
Fatalf writes error to the log and exits.