Skip to main content

rs_utils/log/
mod.rs

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