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. critical_if

critical_if

Macro critical_if 

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

Emit a critical level log message using core::fmt format string semantics if condition is true.

use log_if::critical_if;

const LOG_FACTS: bool = true;
critical_if!(
    LOG_FACTS,
    "Log Fact: Until the {}th century, all ships' masts were made from a single log.",
    19 as u32);