mirror of
https://github.com/tokio-rs/tracing.git
synced 2025-10-02 07:20:35 +00:00
tracing: fix warnings with log
/log-always
features (#753)
This commit fixes up a few new Clippy lints and rustc warnings that occur with the `log`/`log-always` features enabled. Signed-off-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
parent
556cba2b8d
commit
d479ca04bf
@ -2034,11 +2034,11 @@ macro_rules! fieldset {
|
||||
#[macro_export]
|
||||
macro_rules! level_to_log {
|
||||
($level:expr) => {
|
||||
match $level {
|
||||
&$crate::Level::ERROR => $crate::log::Level::Error,
|
||||
&$crate::Level::WARN => $crate::log::Level::Warn,
|
||||
&$crate::Level::INFO => $crate::log::Level::Info,
|
||||
&$crate::Level::DEBUG => $crate::log::Level::Debug,
|
||||
match *$level {
|
||||
$crate::Level::ERROR => $crate::log::Level::Error,
|
||||
$crate::Level::WARN => $crate::log::Level::Warn,
|
||||
$crate::Level::INFO => $crate::log::Level::Info,
|
||||
$crate::Level::DEBUG => $crate::log::Level::Debug,
|
||||
_ => $crate::log::Level::Trace,
|
||||
}
|
||||
};
|
||||
@ -2327,7 +2327,7 @@ macro_rules! __tracing_log {
|
||||
#[macro_export]
|
||||
macro_rules! if_log_enabled {
|
||||
($e:expr;) => {
|
||||
$crate::if_log_enabled! {{ $e }}
|
||||
$crate::if_log_enabled! { $e }
|
||||
};
|
||||
($if_log:block) => {
|
||||
$crate::if_log_enabled! { $if_log else {} }
|
||||
@ -2342,7 +2342,7 @@ macro_rules! if_log_enabled {
|
||||
#[macro_export]
|
||||
macro_rules! if_log_enabled {
|
||||
($e:expr;) => {
|
||||
$crate::if_log_enabled! {{ $e }}
|
||||
$crate::if_log_enabled! { $e }
|
||||
};
|
||||
($if_log:block) => {
|
||||
$crate::if_log_enabled! { $if_log else {} }
|
||||
@ -2361,12 +2361,13 @@ macro_rules! if_log_enabled {
|
||||
#[macro_export]
|
||||
macro_rules! if_log_enabled {
|
||||
($e:expr;) => {
|
||||
$crate::if_log_enabled! {{ $e }}
|
||||
$crate::if_log_enabled! { $e }
|
||||
};
|
||||
($if_log:block) => {
|
||||
$crate::if_log_enabled! { $if_log else {} }
|
||||
};
|
||||
($if_log:block else $else_block:block) => {
|
||||
#[allow(unused_braces)]
|
||||
$if_log
|
||||
};
|
||||
}
|
||||
|
@ -366,7 +366,7 @@ pub struct Entered<'a> {
|
||||
|
||||
/// `log` target for span lifecycle (creation/enter/exit/close) records.
|
||||
#[cfg(feature = "log")]
|
||||
const LIFECYCLE_LOG_TARGET: &'static str = "tracing::span";
|
||||
const LIFECYCLE_LOG_TARGET: &str = "tracing::span";
|
||||
|
||||
// ===== impl Span =====
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user