stdlog

package module
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const Discard noop = "noop"

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int
const (
	LevelDebug Level = iota
	LevelInfo
	LevelWarning
	LevelError
	LevelFatal
)

func (Level) String

func (l Level) String() string

type Logger

type Logger interface {
	// Named returns a new logger with its previous name followed by a dot,
	// followed by the provided name.
	Named(name string) Logger

	// SetLevel sets the logger level.
	SetLevel(level Level)

	// Leveled returns a copy of the current logger with a different level.
	Leveled(level Level) Logger

	// WithFields returns a copy of the current logger with extra provided
	// fields that will be present in every emitted log message.
	WithFields(keysAndValues ...any) Logger

	// Skipping returns a copy of the current logger that will skip a given
	// number of call stacks.
	Skipping(count uint) Logger

	Debug(msg string, keysAndValues ...any)
	Info(msg string, keysAndValues ...any)
	Warning(msg string, keysAndValues ...any)
	Error(err error, msg string, keysAndValues ...any)
	Fatal(msg string, keysAndValues ...any)
	FatalError(err error, msg string, keysAndValues ...any)
}

func NewStd added in v0.0.8

func NewStd(writer io.Writer) Logger

func NewStdJSON added in v0.0.8

func NewStdJSON(writer io.Writer) Logger

Jump to

Keyboard shortcuts

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