log

Macro log 

Source
macro_rules! log {
    ($($arg:tt)+) => { ... };
}
Expand description

Macros for convenient logging with string formatting support

These macros provide a convenient way to log messages with format string support, similar to the standard library’s println! macro family.

§Examples

use nonblocking_logger::{info, debug, error};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let user_id = 42;
    let status = "active";
     
    // Simple string
    info!("User logged in");
     
    // With formatting
    info!("User {} has status: {}", user_id, status);
     
    // With debug formatting
    debug!("Debug info: {:?}", vec![1, 2, 3]);
     
    // Error with formatting
    error!("Failed to process user {}: {}", user_id, "connection timeout");
     
    Ok(())
}

Log a message using format string syntax (always outputs, no level filtering)

§Examples

use nonblocking_logger::log;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let count = 5;
     
    // Using global logger
    log!("Processing {} items", count)?;
     
    Ok(())
}