logger

package
v0.0.0-...-9a1086c Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendSlogAttributesToCtx

func AppendSlogAttributesToCtx(ctx context.Context, attributes []slog.Attr) context.Context

Appends slog attributes to the given context. The modified context is then returned.

func Error

func Error(err error) slog.Attr

func SetupLogger

func SetupLogger(debugLoggingEnabled, devModeEnabled bool)

Sets up the logger.

Types

type ContextualSlogAttributesHandler

type ContextualSlogAttributesHandler struct {
	slog.Handler
}

func (*ContextualSlogAttributesHandler) Handle

Retrieves slog attributes present in the context and appends them to the slog record (log event). The slog handler is then invoked with the modified record. We do this to print out the contextual slog attributes.

type SlogAttributesCtxKey

type SlogAttributesCtxKey struct{}

Jump to

Keyboard shortcuts

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