Documentation
¶
Overview ¶
Package slogx wraps log/slog with convenience helpers so callers only need a single import for structured logging.
It re-exports the most commonly used slog types and functions, adds context-based logger passing, format configuration (JSON, pretty, text), and a small set of attribute helpers.
Index ¶
Constants ¶
View Source
const ( LevelDebug = slog.LevelDebug LevelInfo = slog.LevelInfo LevelWarn = slog.LevelWarn LevelError = slog.LevelError )
Re-export slog levels so callers don't need to import both packages.
Variables ¶
View Source
var ( String = slog.String Int = slog.Int Int64 = slog.Int64 Bool = slog.Bool Float64 = slog.Float64 Duration = slog.Duration Time = slog.Time Any = slog.Any Group = slog.Group )
Re-export common slog attribute constructors.
Functions ¶
func FromContext ¶
FromContext retrieves a logger from the context. Returns slog.Default() if none is set.
Types ¶
Click to show internal directories.
Click to hide internal directories.