Documentation
¶
Overview ¶
Package logger provides functions for working with structured logging via context.Context.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext attempts to return a slog.Logger stored within the provided context.Context. Returns slog.Default if the context does not contain a logger.
func LevelFromString ¶
LevelFromString converts a provided string into its corresponding slog.Level. Returns slog.LevelInfo for an invalid string.
func Middleware ¶
func Middleware(logger *slog.Logger) server.Middleware
Middleware is a server.Middleware implementation that ensures each inbound HTTP request's context contains the slog.Logger.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.