log::error!
[-] [+]
[src]
macro_rules! error { ($($arg:tt)*) => (log!(::log::ERROR, $($arg)*)) }
A convenience macro for logging at the error log level.
Examples
#[macro_use] extern crate log; fn main() { let error = 3; error!("the build has failed with error code: {}", error); }#[macro_use] extern crate log; fn main() { let error = 3; error!("the build has failed with error code: {}", error); }
Assumes the binary is main
:
$ RUST_LOG=error ./main
ERROR:main: the build has failed with error code: 3