mirror of
https://github.com/TrueLayer/reqwest-middleware.git
synced 2024-12-27 03:16:32 +00:00
parent
b49f8b2198
commit
3604b1436b
1 changed files with 5 additions and 10 deletions
|
@ -11,13 +11,8 @@ use retry_policies::RetryPolicy;
|
||||||
|
|
||||||
#[cfg(feature = "tracing")]
|
#[cfg(feature = "tracing")]
|
||||||
type LogLevel = ::tracing::Level;
|
type LogLevel = ::tracing::Level;
|
||||||
#[cfg(feature = "tracing")]
|
|
||||||
use ::tracing as LogTracing;
|
|
||||||
|
|
||||||
#[cfg(all(feature = "log", not(feature = "tracing")))]
|
#[cfg(all(feature = "log", not(feature = "tracing")))]
|
||||||
type LogLevel = ::log::Level;
|
type LogLevel = ::log::Level;
|
||||||
#[cfg(all(feature = "log", not(feature = "tracing")))]
|
|
||||||
use ::log as LogTracing;
|
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
// We need this macro because tracing expects the level to be const:
|
// We need this macro because tracing expects the level to be const:
|
||||||
|
@ -25,11 +20,11 @@ use ::log as LogTracing;
|
||||||
macro_rules! log_retry {
|
macro_rules! log_retry {
|
||||||
($level:expr, $($args:tt)*) => {{
|
($level:expr, $($args:tt)*) => {{
|
||||||
match $level {
|
match $level {
|
||||||
LogLevel::TRACE => LogTracing::trace!($($args)*),
|
LogLevel::TRACE => ::tracing::trace!($($args)*),
|
||||||
LogLevel::DEBUG => LogTracing::debug!($($args)*),
|
LogLevel::DEBUG => ::tracing::debug!($($args)*),
|
||||||
LogLevel::INFO => LogTracing::info!($($args)*),
|
LogLevel::INFO => ::tracing::info!($($args)*),
|
||||||
LogLevel::WARN => LogTracing::warn!($($args)*),
|
LogLevel::WARN => ::tracing::warn!($($args)*),
|
||||||
LogLevel::ERROR => LogTracing::error!($($args)*),
|
LogLevel::ERROR => ::tracing::error!($($args)*),
|
||||||
}
|
}
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue