test

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	Level   logging.Level
	Fields  map[string]interface{}
	Message string
}

LogEntry represents a log message.

type Logger

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

Logger implementation that buffers messages for test purposes.

func New

func New() *Logger

New instantiates new Logger.

func (*Logger) Debug

func (l *Logger) Debug(f string, a ...interface{})

Debug buffers a log message.

func (*Logger) Entries

func (l *Logger) Entries() []LogEntry

Entries returns buffered log entries.

func (*Logger) Error

func (l *Logger) Error(f string, a ...interface{})

Error buffers a log message.

func (*Logger) GetLevel

func (l *Logger) GetLevel() logging.Level

GetLevel get log level.

func (*Logger) Info

func (l *Logger) Info(f string, a ...interface{})

Info buffers a log message.

func (*Logger) SetLevel

func (l *Logger) SetLevel(level logging.Level)

SetLevel set log level.

func (*Logger) Warn

func (l *Logger) Warn(f string, a ...interface{})

Warn buffers a log message.

func (*Logger) WithFields

func (l *Logger) WithFields(fields map[string]interface{}) logging.Logger

WithFields provides additional fields to include in log output. Implemented here primarily to be able to switch between implementations without loss of data.

Jump to

Keyboard shortcuts

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