Expand description
One-time tracing and log-sink initialization for the CLI process.
The CLI initializes logging before database startup and command dispatch so any later failure, including bootstrap cleanup failures, can be written to both the terminal and the rotating log file. This module intentionally keeps the global tracing subscriber setup isolated from the rest of startup.
Staticsยง
Functionsยง
- init
- Initialize the process-wide tracing subscriber and log file sink.
The function is idempotent: the first successful call installs the global
subscriber, creates the log directory if needed, and keeps the file writer
guard alive for the remainder of the process. Subsequent calls are no-ops.
log_levelcontrols the console filter, whilefile_log_levelcontrols the file sink. Both are parsed throughEnvFilter, so the configuration accepts standard tracing filter syntax rather than a bespoke log-level enum.