Skip to main content

log

Macro log 

Source
macro_rules! log {
    ($level:expr, $($arg:tt)*) => { ... };
}
Expand description

Logs a message at the given level only if RUST_LOG allows it. Formatting is lazy: format!(...) runs only when the level is enabled, avoiding allocation when filtered out.

ยงExample

use urlogger::{log, LogLevel};
log!(LogLevel::Info, "user {} did {}", 42, "login");