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

infof_if

Macro infof_if 

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

Emit an info level log message using printf format string semantics if condition is true.

use log_if::infof_if;

const LOG_FACTS: bool = true;
infof_if!(
    LOG_FACTS,
    "Log Fact: The American president Abraham Lincoln (born %x) once lived in a log cabin.",
    0x1809);