Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext returns the logger in ctx, or a logger that discards every record when ctx has none.
func NewContext ¶
NewContext returns a copy of ctx that carries logger.
func NewHandler ¶
NewHandler returns the slog handler for format that writes records at level or above to w. FormatText uses slog.TextHandler, which writes logfmt key=value lines. FormatJSON uses slog.JSONHandler. Both resolve slog.LogValuer attributes.
Types ¶
type Format ¶
type Format string
Format names an output format that the --format flag selects.
func ParseFormat ¶
ParseFormat returns the Format named by s, or an error that lists the valid formats.