mirror of
https://github.com/TrueLayer/reqwest-middleware.git
synced 2024-12-26 19:06:31 +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")]
|
||||
type LogLevel = ::tracing::Level;
|
||||
#[cfg(feature = "tracing")]
|
||||
use ::tracing as LogTracing;
|
||||
|
||||
#[cfg(all(feature = "log", not(feature = "tracing")))]
|
||||
type LogLevel = ::log::Level;
|
||||
#[cfg(all(feature = "log", not(feature = "tracing")))]
|
||||
use ::log as LogTracing;
|
||||
|
||||
#[doc(hidden)]
|
||||
// We need this macro because tracing expects the level to be const:
|
||||
|
@ -25,11 +20,11 @@ use ::log as LogTracing;
|
|||
macro_rules! log_retry {
|
||||
($level:expr, $($args:tt)*) => {{
|
||||
match $level {
|
||||
LogLevel::TRACE => LogTracing::trace!($($args)*),
|
||||
LogLevel::DEBUG => LogTracing::debug!($($args)*),
|
||||
LogLevel::INFO => LogTracing::info!($($args)*),
|
||||
LogLevel::WARN => LogTracing::warn!($($args)*),
|
||||
LogLevel::ERROR => LogTracing::error!($($args)*),
|
||||
LogLevel::TRACE => ::tracing::trace!($($args)*),
|
||||
LogLevel::DEBUG => ::tracing::debug!($($args)*),
|
||||
LogLevel::INFO => ::tracing::info!($($args)*),
|
||||
LogLevel::WARN => ::tracing::warn!($($args)*),
|
||||
LogLevel::ERROR => ::tracing::error!($($args)*),
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue