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

error_if

Macro error_if 

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

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

use log_if::error_if;

const LOG_FACTS: bool = true;
error_if!(
    LOG_FACTS,
    "Log Fact: Before saws were invented, the {} was used prepare logs for use.",
    "adze" as &str);