Skip to main content

init_from_env

Function init_from_env 

Source
pub fn init_from_env(var_name: &str, default: Level)
Expand description

Initialize log level from an environment variable.

Checks the specified environment variable and parses it as a log level. If the variable is not set or cannot be parsed, uses the provided default.

ยงExamples

use lean_log::Level;
// Check RUST_LOG, default to Info
lean_log::init_from_env("RUST_LOG", Level::Info);