Documentation ¶
Index ¶
- func NewReplayLogger(logger log.Logger, isReplay *bool, enableLoggingInReplay *bool) log.Logger
- func With(logger log.Logger, keyvals ...interface{}) 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
- func (l *MemoryLogger) Debug(msg string, keyvals ...interface{})
- func (l *MemoryLogger) Error(msg string, keyvals ...interface{})
- func (l *MemoryLogger) Info(msg string, keyvals ...interface{})
- func (l *MemoryLogger) Lines() []string
- func (l *MemoryLogger) Warn(msg string, keyvals ...interface{})
- func (l *MemoryLogger) With(keyvals ...interface{}) log.Logger
- type NopLogger
- func (l *NopLogger) Debug(msg string, keyvals ...interface{})
- func (l *NopLogger) Error(msg string, keyvals ...interface{})
- func (l *NopLogger) Info(msg string, keyvals ...interface{})
- func (l *NopLogger) Warn(msg string, keyvals ...interface{})
- func (l *NopLogger) With(keyvals ...interface{}) log.Logger
- 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
- type TestReporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewReplayLogger ¶
NewReplayLogger crates new instance of ReplayLogger.
Types ¶
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
DefaultLogger is Logger implementation on top of standart 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 {
// contains filtered or unexported fields
}
MemoryLogger is Logger implementation that stores logs in memory (useful for testing). Use Lines() to get log lines.
func NewMemoryLogger ¶
func NewMemoryLogger() *MemoryLogger
NewMemoryLogger creates new instance of MemoryLogger.
func (*MemoryLogger) Debug ¶
func (l *MemoryLogger) Debug(msg string, keyvals ...interface{})
Debug appends message to the log.
func (*MemoryLogger) Error ¶
func (l *MemoryLogger) Error(msg string, keyvals ...interface{})
Error appends message to the log.
func (*MemoryLogger) Info ¶
func (l *MemoryLogger) Info(msg string, keyvals ...interface{})
Info appends message to the log.
func (*MemoryLogger) Lines ¶
func (l *MemoryLogger) Lines() []string
Lines returns written log lines.
func (*MemoryLogger) Warn ¶
func (l *MemoryLogger) Warn(msg string, keyvals ...interface{})
Warn appends message to the log.
func (*MemoryLogger) With ¶
func (l *MemoryLogger) With(keyvals ...interface{}) log.Logger
With returns new logger the prepend every log entry with keyvals.
type NopLogger ¶
type NopLogger struct { }
NopLogger is Logger implementation that doesn't produce any logs.
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 the prepend every log entry with keyvals.
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.