Skip to main content Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. Rust
  4. pw_kernel
  5. log_if
  6. warnf_if

warnf_if

Macro warnf_if 

Source
macro_rules! warnf_if {
    ($condition:expr, $($args:expr),* $(,)?) => { ... };
}
Expand description

Emit a warn level log message using printf format string semantics if condition is true.

use log_if::warnf_if;

const LOG_FACTS: bool = true;
warnf_if!(
    LOG_FACTS,
    "Log Fact: Made from a log, an %d year old dugout canoe is the oldest discovered boat in %s.",
    8000, "Africa");