#[cfg(not(feature = "tracing"))]
#[derive(Clone, Debug)]
pub(crate) struct Span {}
#[cfg(feature = "tracing")]
macro_rules! trace {
($($arg:tt)+) => {
tracing::trace!($($arg)+)
};
}
#[cfg(not(feature = "tracing"))]
macro_rules! trace {
($($arg:tt)+) => {};
}
#[cfg(feature = "tracing")]
macro_rules! debug {
($($arg:tt)+) => {
tracing::debug!($($arg)+)
};
}
#[cfg(not(feature = "tracing"))]
macro_rules! debug {
($($arg:tt)+) => {};
}
#[cfg(feature = "tracing")]
macro_rules! warn {
($($arg:tt)+) => {
tracing::warn!($($arg)+)
};
}
#[cfg(not(feature = "tracing"))]
macro_rules! warn {
($($arg:tt)+) => {};
}
#[cfg(feature = "tracing")]
macro_rules! error {
($($arg:tt)+) => {
tracing::error!($($arg)+)
};
}
#[cfg(not(feature = "tracing"))]
macro_rules! error {
($($arg:tt)+) => {};
}
#[cfg(feature = "tracing")]
macro_rules! trace_span {
($($arg:tt)+) => {
tracing::trace_span!($($arg)+)
};
}
#[cfg(not(feature = "tracing"))]
macro_rules! trace_span {
($($arg:tt)+) => {
crate::tracing::Span::new()
};
}
#[cfg(not(feature = "tracing"))]
impl Span {
pub(crate) fn new() -> Self {
Span {}
}
pub(crate) fn enter(&self) -> Span {
Span {}
}
}