log

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReplayLogger

func NewReplayLogger(logger log.Logger, isReplay *bool, enableLoggingInReplay *bool) log.Logger

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 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 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL