Skip to main content

log_init

Function log_init 

Source
pub fn log_init(level: u8, path: Option<&Path>) -> Status
Expand description

Install the global tracing subscriber.

level is the C-style numeric verbosity in 0..=LOG_LEVEL_MAX. Values above the maximum saturate. When path is Some, log records are appended to that file (created if missing); when None, records are written to standard error.

This entry point preserves the historical default output shape (LogFormat::Default). To pick a different shape, call log_init_with_format directly. Both wrappers delegate to install_logs_only.

log_init may be called only once per process; subsequent calls return DynError::Generic.

ยงExamples

use dynomite::core::log::{log_init, LOG_NOTICE};
log_init(LOG_NOTICE, None).expect("install logger");