Documentation
¶
Overview ¶
Package logging provides context-aware structured logging wrapping log/slog.
In production mode a JSON handler is used; in development mode a coloured tint handler makes output easy to scan. Loggers are threaded through context.Context so that request-scoped attributes propagate automatically.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext extracts the logger stored in ctx. If no logger is found the package-level default logger is returned.
func New ¶
New creates a new *slog.Logger. When production is true a JSON handler writing to stdout is used; otherwise a tint handler with coloured output and timestamps is returned.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.