Skip to main content

rex_logger/
macros.rs

1#[macro_export]
2macro_rules! trace {
3    (target: $target:expr, $($args:tt)*) => {
4        $crate::tracing::trace!(target: $target, $($args)*)
5    };
6    ($($args:tt)*) => {
7        $crate::tracing::trace!($($args)*)
8    };
9}
10
11#[macro_export]
12macro_rules! debug {
13    (target: $target:expr, $($args:tt)*) => {
14        $crate::tracing::debug!(target: $target, $($args)*)
15    };
16    ($($args:tt)*) => {
17        $crate::tracing::debug!($($args)*)
18    };
19}
20
21#[macro_export]
22macro_rules! info {
23    (target: $target:expr, $($args:tt)*) => {
24        $crate::tracing::info!(target: $target, $($args)*)
25    };
26    ($($args:tt)*) => {
27        $crate::tracing::info!($($args)*)
28    };
29}
30
31#[macro_export]
32macro_rules! warn {
33    (target: $target:expr, $($args:tt)*) => {
34        $crate::tracing::warn!(target: $target, $($args)*)
35    };
36    ($($args:tt)*) => {
37        $crate::tracing::warn!($($args)*)
38    };
39}
40
41#[macro_export]
42macro_rules! error {
43    (target: $target:expr, $($args:tt)*) => {
44        $crate::tracing::error!(target: $target, $($args)*)
45    };
46    ($($args:tt)*) => {
47        $crate::tracing::error!($($args)*)
48    };
49}