Module log

Module log 

Source
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

  1. All logs MUST go to stderr: This is enforced by .with_writer(std::io::stderr) on all tracing_subscriber::fmt() calls. This ensures commands like sesame --print-config > config.toml produce clean output files.

  2. Centralized configuration: All logging setup is in this single module to prevent future developers from accidentally creating stdout loggers.

  3. 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