#![allow(unused_imports)]
#[cfg(feature = "tracing")]
pub(crate) use tracing::{debug, debug_span, error, info, info_span, trace, warn, Instrument};
#[cfg(not(feature = "tracing"))]
pub(crate) use self::noop::*;
#[cfg(not(feature = "tracing"))]
mod noop {
#[macro_export]
#[doc(hidden)]
macro_rules! __docker_wrapper_tracing_event_noop {
($($tt:tt)*) => {{}};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __docker_wrapper_tracing_span_noop {
($($tt:tt)*) => {{
$crate::tracing_compat::NoopSpan
}};
}
pub(crate) use crate::__docker_wrapper_tracing_event_noop as debug;
pub(crate) use crate::__docker_wrapper_tracing_event_noop as error;
pub(crate) use crate::__docker_wrapper_tracing_event_noop as info;
pub(crate) use crate::__docker_wrapper_tracing_event_noop as trace;
pub(crate) use crate::__docker_wrapper_tracing_event_noop as warn;
pub(crate) use crate::__docker_wrapper_tracing_span_noop as debug_span;
pub(crate) use crate::__docker_wrapper_tracing_span_noop as info_span;
}
#[cfg(not(feature = "tracing"))]
#[derive(Copy, Clone, Debug)]
pub(crate) struct NoopSpan;
#[cfg(not(feature = "tracing"))]
#[allow(dead_code, clippy::unused_self, clippy::trivially_copy_pass_by_ref)]
impl NoopSpan {
pub(crate) fn in_scope<F: FnOnce() -> R, R>(&self, f: F) -> R {
f()
}
pub(crate) fn record<V>(&self, _field: &'static str, _value: V) -> &Self {
self
}
}
#[cfg(not(feature = "tracing"))]
pub(crate) trait Instrument: Sized {
fn instrument(self, _span: NoopSpan) -> Self {
self
}
}
#[cfg(not(feature = "tracing"))]
impl<T> Instrument for T {}