log

package
v2.23.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NullLogger = &nullLogger{}

NullLogger is implementation of the Logger interface that is no-op

View Source
var StdLogger = &stdLogger{}

StdLogger is implementation of the Logger interface that delegates to default `log` package

Functions

This section is empty.

Types

type BytesBufferLogger added in v2.11.1

type BytesBufferLogger struct {
	// contains filtered or unexported fields
}

BytesBufferLogger implements Logger backed by a bytes.Buffer.

func (*BytesBufferLogger) Debugf added in v2.23.0

func (l *BytesBufferLogger) Debugf(msg string, args ...interface{})

Debugf implements Logger.

func (*BytesBufferLogger) Error added in v2.11.1

func (l *BytesBufferLogger) Error(msg string)

Error implements Logger.

func (*BytesBufferLogger) Flush added in v2.12.0

func (l *BytesBufferLogger) Flush()

Flush empties the underlying buffer.

func (*BytesBufferLogger) Infof added in v2.11.1

func (l *BytesBufferLogger) Infof(msg string, args ...interface{})

Infof implements Logger.

func (*BytesBufferLogger) String added in v2.11.1

func (l *BytesBufferLogger) String() string

String returns string representation of the underlying buffer.

type DebugLogger added in v2.23.0

type DebugLogger interface {
	Logger

	// Debugf logs a message at debug priority
	Debugf(msg string, args ...interface{})
}

DebugLogger is an interface which adds a debug logging level

func DebugLogAdapter added in v2.23.0

func DebugLogAdapter(logger Logger) DebugLogger

DebugLogAdapter is a log adapter that converts a Logger into a DebugLogger If the provided Logger doesn't satisfy the interface, a logger with debug disabled is returned

type Logger

type Logger interface {
	// Error logs a message at error priority
	Error(msg string)

	// Infof logs a message at info priority
	Infof(msg string, args ...interface{})
}

Logger provides an abstract interface for logging from Reporters. Applications can provide their own implementation of this interface to adapt reporters logging to whatever logging library they prefer (stdlib log, logrus, go-logging, etc).

Directories

Path Synopsis
zap
mock_opentracing
Package mock_opentracing is a generated GoMock package.
Package mock_opentracing is a generated GoMock package.

Jump to

Keyboard shortcuts

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