Macro pw_log::logf

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

Emit a log message using printf format string semantics.

logf takes a LogLevel, a printf style format string, and necessary arguments to that string and emits a log message to the logging backend.

use pw_log::{logf, LogLevel};

logf!(LogLevel::Info, "Log fact: A %s log has a Janka hardness of %d lbf.",
    "Spruce Pine", 700);