Documentation
¶
Overview ¶
Package logutil provides small helpers for structured logging.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Level ¶
Level maps a string to slog.Level. Unknown values default to Info. Accepts (case-insensitive): "debug", "info", "warn", "warning", "error".
func SafeField ¶
SafeField strips C0 control characters and DEL from s, returning a string safe to include as a structured log field value. Use it to wrap any field derived from HTTP input (paths, headers, query strings, error messages carrying user data) before passing to slog, to prevent log forging via embedded newlines or terminal escape sequences.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.