log

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const LevelTrace = slog.LevelDebug - 4

LevelTrace is a custom trace level for slog Using LevelDebug - 4 which equals -8

Variables

View Source
var LoggerKey = Key{}

Functions

func ConfigLevelStringToSlogLevel

func ConfigLevelStringToSlogLevel(level string) slog.Level

func DisableErrorMirroring added in v0.2.0

func DisableErrorMirroring()

DisableErrorMirroring stops mirroring error level logs to the secondary handler. This is used for interactive commands where stderr output would disrupt the UI.

func EnableErrorMirroring added in v0.2.0

func EnableErrorMirroring()

EnableErrorMirroring ensures error level logs are mirrored to the secondary handler when one is configured.

func NewDualHandler added in v0.2.0

func NewDualHandler(primary slog.Handler, secondary slog.Handler) slog.Handler

NewDualHandler wraps a primary slog.Handler and, optionally, a secondary handler that only receives error level records when mirroring is enabled.

func NewFriendlyErrorHandler added in v0.3.2

func NewFriendlyErrorHandler(w io.Writer) slog.Handler

NewFriendlyErrorHandler returns a slog.Handler that renders error records in a concise, human-friendly format suitable for console output.

Types

type Key

type Key struct{}

Jump to

Keyboard shortcuts

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