log::error!
[−]
[src]
macro_rules! error { ($($arg:tt)*) => { ... }; }
Unstable (
rustc_private
): use the crates.io log
library instead
A convenience macro for logging at the error log level.
Examples
#![feature(rustc_private)] #[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