log

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseLogLevel added in v1.0.12

func ParseLogLevel(input string) slog.Level

Types

type Logger

type Logger struct {
	*slog.Logger
	// contains filtered or unexported fields
}

Logger is a wrapper around a slog.logger, which keeps track of prefixes and raw keys, such that prefixese can be added in a hierarchical manner.

func Default added in v1.1.10

func Default() *Logger

Default logger is simply at INFO level.

func NewLogger

func NewLogger(rawLogLevel string) *Logger

Create a new logger without a prefix

func NewLoggerWithPrefixes added in v1.1.10

func NewLoggerWithPrefixes(rawLogLevel string, prefixes []string) *Logger

Create a new logger with a set of prefixes.

func (*Logger) ApplyPrefix

func (l *Logger) ApplyPrefix(prefix string) *Logger

Add an additional prefix to the logger

func (*Logger) With added in v1.1.10

func (l *Logger) With(args ...any) *Logger

Add a value to the logger

Jump to

Keyboard shortcuts

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