log

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugLevel

func DebugLevel() uint32

func IsDebugLevel

func IsDebugLevel(l Logger) bool

Types

type Logger

type Logger interface {
	Info(string, ...any)
	Warn(string, ...any)
	Debug(string, ...any)
	Error(string, ...any)
	Fatal(string, ...any)
	Panic(string, ...any)
	Trace(string, ...any)

	SetLevel(level uint32)
	GetLevel() uint32
	SetOutput(writer io.Writer)
}

Logger is the interface we want for our logger, so we can plug different ones easily

func New

func New(opts ...LoggerOptions) Logger

type LoggerOptions

type LoggerOptions func(l *log.Logger)

func WithBuffer

func WithBuffer(b *bytes.Buffer) LoggerOptions

WithBuffer will set a logger that stores all logs in a buffer, used mainly for testing

func WithDiscardAll

func WithDiscardAll() LoggerOptions

WithDiscardAll will set a logger that discards all logs, used mainly for testing

Jump to

Keyboard shortcuts

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