Macro log::debug [] [src]

macro_rules! debug {
    ($($arg:tt)*) => { ... };
}
🔬 This is a nightly-only experimental API. (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

#[macro_use] extern crate log;

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

Assumes the binary is main:

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