-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
59 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/// Performs a tracing debug if the `tracing` feature is enabled. | ||
#[macro_export] | ||
macro_rules! debug { | ||
($($arg:tt)*) => { | ||
#[cfg(feature = "tracing")] | ||
tracing::debug!($($arg)*); | ||
}; | ||
} | ||
pub use debug; | ||
|
||
/// Performs a tracing info if the `tracing` feature is enabled. | ||
#[macro_export] | ||
macro_rules! info { | ||
($($arg:tt)*) => { | ||
#[cfg(feature = "tracing")] | ||
tracing::info!($($arg)*); | ||
}; | ||
} | ||
pub use info; | ||
|
||
/// Performs a tracing error if the `tracing` feature is enabled. | ||
#[macro_export] | ||
macro_rules! error { | ||
($($arg:tt)*) => { | ||
#[cfg(feature = "tracing")] | ||
tracing::error!($($arg)*); | ||
}; | ||
} | ||
pub use error; | ||
|
||
/// Performs a tracing warn if the `tracing` feature is enabled. | ||
#[macro_export] | ||
macro_rules! warn { | ||
($($arg:tt)*) => { | ||
#[cfg(feature = "tracing")] | ||
tracing::warn!($($arg)*); | ||
}; | ||
} | ||
pub use crate::warn; | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn test_debug() { | ||
debug!("test"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters