logger

package
v0.3.25 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureLogging

func ConfigureLogging(mode LogMode)

func ConfigureTestLogging

func ConfigureTestLogging(t tTesting)

ConfigureTestLogging allows logs to be associated with individual tests

func ContextWithNodeIDLogger

func ContextWithNodeIDLogger(ctx context.Context, nodeID string) context.Context

ContextWithNodeIDLogger will return a context with nodeID is added to the logging context.

func LogBufferedLogs

func LogBufferedLogs(writer io.Writer)

LogBufferedLogs will log any log messages written from before logging was configured to the given writer. If writer is nil, then the default logging will be used instead. This function will do nothing once the buffer has been outputted.

func LogStream

func LogStream(ctx context.Context, r io.Reader)

func ToSliceStringer added in v0.3.24

func ToSliceStringer[T any](ts []T, f func(t T) string) []fmt.Stringer

func ToStringer added in v0.3.24

func ToStringer[T any](t T, f func(t T) string) fmt.Stringer

Types

type LogMode

type LogMode string
const (
	LogModeDefault  LogMode = "default"
	LogModeStation  LogMode = "station"
	LogModeJSON     LogMode = "json"
	LogModeCombined LogMode = "combined"
	LogModeEvent    LogMode = "event"
)

Available logging modes

func ParseLogMode

func ParseLogMode(s string) (LogMode, error)

Directories

Path Synopsis
testpackage

Jump to

Keyboard shortcuts

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