Documentation
¶
Overview ¶
Package slogger provides a shared LOG_LEVEL-aware slog initialization helper.
Call Init() at the start of any service's main() to configure the global slog logger based on the LOG_LEVEL environment variable. This also bridges legacy log.Print* calls through slog (Go 1.22+ behaviour via slog.SetDefault).
Valid LOG_LEVEL values: "debug", "info", "warn", "error". Default: "info".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init()
Init reads the LOG_LEVEL environment variable, configures a global slog TextHandler on stdout, and sets it as the default logger. Legacy log.Print* calls are automatically routed through this handler (Go 1.22+).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.