Expand description
Centralized logging configuration for Open Sesame
Ensures all tracing output goes to stderr (never stdout) to prevent corruption of user-facing output during stdout redirection.
§Critical Design Requirements
-
All logs MUST go to stderr: This is enforced by
.with_writer(std::io::stderr)on alltracing_subscriber::fmt()calls. This ensures commands likesesame --print-config > config.tomlproduce clean output files. -
Centralized configuration: All logging setup is in this single module to prevent future developers from accidentally creating stdout loggers.
-
Three logging modes:
- Default: SILENT (no logging at all)
- With RUST_LOG env: file logging at specified level
- With debug-logging feature: file logging at DEBUG level
§Usage
use open_sesame::util::log;
log::init();
tracing::info!("Application started");Functions§
- init
- Initialize the logging subsystem