add trace macro for more verbose debug statements

This commit is contained in:
Mark McCaskey
2019-05-15 11:46:17 -07:00
parent 245cc32937
commit a9f643f774
4 changed files with 22 additions and 2 deletions

View File

@ -18,6 +18,24 @@ macro_rules! debug {
($fmt:expr, $($arg:tt)*) => {};
}
#[macro_export]
#[cfg(feature = "trace")]
macro_rules! trace {
($fmt:expr) => {
debug!($fmt)
};
($fmt:expr, $($arg:tt)*) => {
debug!($fmt, $($arg)*);
}
}
#[macro_export]
#[cfg(not(feature = "trace"))]
macro_rules! trace {
($fmt:expr) => {};
($fmt:expr, $($arg:tt)*) => {};
}
#[macro_export]
macro_rules! func {
($func:path) => {{