Macro pw_log::log

source ·
macro_rules! log {
    ($log_level:expr, $format_string:literal) => { ... };
    ($log_level:expr, $format_string:literal, $($args:expr),*) => { ... };
}
Expand description

Emit a log message using core::fmt format string semantics.

log takes a LogLevel, a core::fmt style format string, and necessary arguments to that string and emits a log message to the logging backend.

use pw_log::{log, LogLevel};

log!(LogLevel::Info, "Log fact: A {} log has a Janka hardness of {} lbf.",
     "Spruce Pine" as &str, 700 as i32);