rs_utils/log/
mod.rs

1//! Logging macros
2
3#[doc(hidden)] extern crate log;
4#[doc(hidden)] extern crate stdext;
5
6pub mod kv;
7
8pub use log::LevelFilter;
9
10/// Log trace message that includes the enclosing function name in the target
11pub macro trace {
12  ($($args:tt)*) => {
13    log::trace!(target: stdext::function_name!(), $($args)*)
14  }
15}
16
17/// Log debug message that includes the enclosing function name in the target
18pub macro debug {
19  ($($args:tt)*) => {
20    log::debug!(target: stdext::function_name!(), $($args)*)
21  }
22}
23
24/// Log info message that includes the enclosing function name in the target
25pub macro info {
26  ($($args:tt)*) => {
27    log::info!(target: stdext::function_name!(), $($args)*)
28  }
29}
30
31/// Log warn message that includes the enclosing function name in the target
32pub macro warn {
33  ($($args:tt)*) => {
34    log::warn!(target: stdext::function_name!(), $($args)*)
35  }
36}
37
38/// Log error message that includes the enclosing function name in the target
39pub macro error {
40  ($($args:tt)*) => {
41    log::error!(target: stdext::function_name!(), $($args)*)
42  }
43}