-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtrace.rs
More file actions
43 lines (42 loc) · 998 Bytes
/
Copy pathtrace.rs
File metadata and controls
43 lines (42 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#[cfg(feature = "tracing")]
#[allow(unused)]
pub(crate) use tracing::{debug, error, info, trace, warn};
/// No-op macros used when the `tracing` feature is disabled.
/// They expand to `()` so that they are usable both in statement and
/// expression positions, like the original `tracing` macros.
/// `warn` is defined as `warn_` and re-exported, since a macro named
/// `warn` conflicts with the built-in `warn` attribute (E0659).
#[cfg(not(feature = "tracing"))]
mod noop {
#![allow(unused_macros)]
macro_rules! debug {
($($arg:tt)*) => {
()
};
}
macro_rules! error {
($($arg:tt)*) => {
()
};
}
macro_rules! info {
($($arg:tt)*) => {
()
};
}
macro_rules! trace {
($($arg:tt)*) => {
()
};
}
macro_rules! warn_ {
($($arg:tt)*) => {
()
};
}
#[allow(unused_imports)]
pub(crate) use {debug, error, info, trace, warn_ as warn};
}
#[cfg(not(feature = "tracing"))]
#[allow(unused)]
pub(crate) use noop::*;