log::debug! [] [src]

macro_rules! debug {
    ($($arg:tt)*) => { ... };
}
Unstable (rustc_private)

: use the crates.io log library instead

A convenience macro for logging at the debug log level. This macro will be omitted at compile time in an optimized build unless -C debug-assertions is passed to the compiler.

Examples

#![feature(rustc_private)] #[macro_use] extern crate log; fn main() { debug!("x = {x}, y = {y}", x=10, y=20); }
#[macro_use] extern crate log;

fn main() {
    debug!("x = {x}, y = {y}", x=10, y=20);
}

Assumes the binary is main:

$ RUST_LOG=debug ./main
DEBUG:main: x = 10, y = 20