init_logger

Function init_logger 

Source
pub fn init_logger(verbose: bool, quiet: bool, no_color: bool)
Expand description

Initialize the tracing subscriber with the specified options.

This function sets up structured logging for the CLI. It should be called once at the start of the program, before any logging occurs.

§Arguments

  • verbose - Enable debug-level logging (overrides quiet)
  • quiet - Only show error-level logs
  • no_color - Disable colored output

§Verbosity Levels

The logging level is determined in this order:

  1. --verbose flag: Sets level to DEBUG for fob crates
  2. --quiet flag: Sets level to ERROR only
  3. RUST_LOG environment variable: Custom filter
  4. Default: INFO level for fob crates

§Examples

use fob_cli::logger::init_logger;

// Default logging (INFO level)
init_logger(false, false, false);

// Debug logging
init_logger(true, false, false);

// Quiet mode (errors only)
init_logger(false, true, false);

// No colors (for CI/piped output)
init_logger(false, false, true);