log::warn! [-]  [+] [src]

macro_rules! warn {
    ($($arg:tt)*) => (log!(::log::WARN, $($arg)*))
}

A convenience macro for logging at the warning log level.

Example

#[macro_use] extern crate log;

fn main() {
    let code = 3u;
    warn!("you may like to know that a process exited with: {}", code);
}

Assumes the binary is main:

$ RUST_LOG=warn ./main
WARN:main: you may like to know that a process exited with: 3