diff --git a/tracing/src/macros.rs b/tracing/src/macros.rs index a83229f22..7876aed38 100644 --- a/tracing/src/macros.rs +++ b/tracing/src/macros.rs @@ -1309,10 +1309,10 @@ macro_rules! trace { $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::TRACE, { $($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::TRACE, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::TRACE, { ?$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::TRACE, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::TRACE, { %$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::TRACE, {}, $($arg)+) @@ -1326,10 +1326,10 @@ macro_rules! trace { $crate::event!(name: $name, target: $target, $crate::Level::TRACE, { $($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, $crate::Level::TRACE, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, $crate::Level::TRACE, { ?$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, $crate::Level::TRACE, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, $crate::Level::TRACE, { %$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, target: $target, $crate::Level::TRACE, {}, $($arg)+) @@ -1343,10 +1343,10 @@ macro_rules! trace { $crate::event!(target: $target, parent: $parent, $crate::Level::TRACE, { $($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(target: $target, parent: $parent, $crate::Level::TRACE, { $($k).+ $($field)+ }) + $crate::event!(target: $target, parent: $parent, $crate::Level::TRACE, { ?$($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(target: $target, parent: $parent, $crate::Level::TRACE, { $($k).+ $($field)+ }) + $crate::event!(target: $target, parent: $parent, $crate::Level::TRACE, { %$($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(target: $target, parent: $parent, $crate::Level::TRACE, {}, $($arg)+) @@ -1360,10 +1360,10 @@ macro_rules! trace { $crate::event!(name: $name, parent: $parent, $crate::Level::TRACE, { $($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, parent: $parent, $crate::Level::TRACE, { $($k).+ $($field)+ }) + $crate::event!(name: $name, parent: $parent, $crate::Level::TRACE, { ?$($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, parent: $parent, $crate::Level::TRACE, { $($k).+ $($field)+ }) + $crate::event!(name: $name, parent: $parent, $crate::Level::TRACE, { %$($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, parent: $parent, $crate::Level::TRACE, {}, $($arg)+) @@ -1586,10 +1586,10 @@ macro_rules! debug { $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::DEBUG, { $($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::DEBUG, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::DEBUG, { ?$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::DEBUG, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::DEBUG, { %$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::DEBUG, {}, $($arg)+) @@ -1603,10 +1603,10 @@ macro_rules! debug { $crate::event!(name: $name, target: $target, $crate::Level::DEBUG, { $($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, $crate::Level::DEBUG, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, $crate::Level::DEBUG, { ?$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, $crate::Level::DEBUG, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, $crate::Level::DEBUG, { %$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, target: $target, $crate::Level::DEBUG, {}, $($arg)+) @@ -1620,10 +1620,10 @@ macro_rules! debug { $crate::event!(target: $target, parent: $parent, $crate::Level::DEBUG, { $($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(target: $target, parent: $parent, $crate::Level::DEBUG, { $($k).+ $($field)+ }) + $crate::event!(target: $target, parent: $parent, $crate::Level::DEBUG, { ?$($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(target: $target, parent: $parent, $crate::Level::DEBUG, { $($k).+ $($field)+ }) + $crate::event!(target: $target, parent: $parent, $crate::Level::DEBUG, { %$($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(target: $target, parent: $parent, $crate::Level::DEBUG, {}, $($arg)+) @@ -1637,10 +1637,10 @@ macro_rules! debug { $crate::event!(name: $name, parent: $parent, $crate::Level::DEBUG, { $($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, parent: $parent, $crate::Level::DEBUG, { $($k).+ $($field)+ }) + $crate::event!(name: $name, parent: $parent, $crate::Level::DEBUG, { ?$($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, parent: $parent, $crate::Level::DEBUG, { $($k).+ $($field)+ }) + $crate::event!(name: $name, parent: $parent, $crate::Level::DEBUG, { %$($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, parent: $parent, $crate::Level::DEBUG, {}, $($arg)+) @@ -1874,10 +1874,10 @@ macro_rules! info { $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::INFO, { $($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::INFO, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::INFO, { ?$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::INFO, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::INFO, { %$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::INFO, {}, $($arg)+) @@ -1891,10 +1891,10 @@ macro_rules! info { $crate::event!(name: $name, target: $target, $crate::Level::INFO, { $($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, $crate::Level::INFO, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, $crate::Level::INFO, { ?$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, $crate::Level::INFO, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, $crate::Level::INFO, { %$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, target: $target, $crate::Level::INFO, {}, $($arg)+) @@ -1908,10 +1908,10 @@ macro_rules! info { $crate::event!(target: $target, parent: $parent, $crate::Level::INFO, { $($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(target: $target, parent: $parent, $crate::Level::INFO, { $($k).+ $($field)+ }) + $crate::event!(target: $target, parent: $parent, $crate::Level::INFO, { ?$($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(target: $target, parent: $parent, $crate::Level::INFO, { $($k).+ $($field)+ }) + $crate::event!(target: $target, parent: $parent, $crate::Level::INFO, { %$($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(target: $target, parent: $parent, $crate::Level::INFO, {}, $($arg)+) @@ -1925,10 +1925,10 @@ macro_rules! info { $crate::event!(name: $name, parent: $parent, $crate::Level::INFO, { $($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, parent: $parent, $crate::Level::INFO, { $($k).+ $($field)+ }) + $crate::event!(name: $name, parent: $parent, $crate::Level::INFO, { ?$($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, parent: $parent, $crate::Level::INFO, { $($k).+ $($field)+ }) + $crate::event!(name: $name, parent: $parent, $crate::Level::INFO, { %$($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, parent: $parent, $crate::Level::INFO, {}, $($arg)+) @@ -2155,10 +2155,10 @@ macro_rules! warn { $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::WARN, { $($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::WARN, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::WARN, { ?$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::WARN, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::WARN, { %$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::WARN, {}, $($arg)+) @@ -2172,10 +2172,10 @@ macro_rules! warn { $crate::event!(name: $name, target: $target, $crate::Level::WARN, { $($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, $crate::Level::WARN, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, $crate::Level::WARN, { ?$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, $crate::Level::WARN, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, $crate::Level::WARN, { %$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, target: $target, $crate::Level::WARN, {}, $($arg)+) @@ -2189,10 +2189,10 @@ macro_rules! warn { $crate::event!(target: $target, parent: $parent, $crate::Level::WARN, { $($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(target: $target, parent: $parent, $crate::Level::WARN, { $($k).+ $($field)+ }) + $crate::event!(target: $target, parent: $parent, $crate::Level::WARN, { ?$($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(target: $target, parent: $parent, $crate::Level::WARN, { $($k).+ $($field)+ }) + $crate::event!(target: $target, parent: $parent, $crate::Level::WARN, { %$($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(target: $target, parent: $parent, $crate::Level::WARN, {}, $($arg)+) @@ -2206,10 +2206,10 @@ macro_rules! warn { $crate::event!(name: $name, parent: $parent, $crate::Level::WARN, { $($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, parent: $parent, $crate::Level::WARN, { $($k).+ $($field)+ }) + $crate::event!(name: $name, parent: $parent, $crate::Level::WARN, { ?$($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, parent: $parent, $crate::Level::WARN, { $($k).+ $($field)+ }) + $crate::event!(name: $name, parent: $parent, $crate::Level::WARN, { %$($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, parent: $parent, $crate::Level::WARN, {}, $($arg)+) @@ -2432,10 +2432,10 @@ macro_rules! error { $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::ERROR, { $($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::ERROR, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::ERROR, { ?$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::ERROR, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::ERROR, { %$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, target: $target, parent: $parent, $crate::Level::ERROR, {}, $($arg)+) @@ -2449,10 +2449,10 @@ macro_rules! error { $crate::event!(name: $name, target: $target, $crate::Level::ERROR, { $($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, $crate::Level::ERROR, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, $crate::Level::ERROR, { ?$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, target: $target, $crate::Level::ERROR, { $($k).+ $($field)+ }) + $crate::event!(name: $name, target: $target, $crate::Level::ERROR, { %$($k).+ $($field)+ }) ); (name: $name:expr, target: $target:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, target: $target, $crate::Level::ERROR, {}, $($arg)+) @@ -2466,10 +2466,10 @@ macro_rules! error { $crate::event!(target: $target, parent: $parent, $crate::Level::ERROR, { $($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(target: $target, parent: $parent, $crate::Level::ERROR, { $($k).+ $($field)+ }) + $crate::event!(target: $target, parent: $parent, $crate::Level::ERROR, { ?$($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(target: $target, parent: $parent, $crate::Level::ERROR, { $($k).+ $($field)+ }) + $crate::event!(target: $target, parent: $parent, $crate::Level::ERROR, { %$($k).+ $($field)+ }) ); (target: $target:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(target: $target, parent: $parent, $crate::Level::ERROR, {}, $($arg)+) @@ -2483,10 +2483,10 @@ macro_rules! error { $crate::event!(name: $name, parent: $parent, $crate::Level::ERROR, { $($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, ?$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, parent: $parent, $crate::Level::ERROR, { $($k).+ $($field)+ }) + $crate::event!(name: $name, parent: $parent, $crate::Level::ERROR, { ?$($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, %$($k:ident).+ $($field:tt)+ ) => ( - $crate::event!(name: $name, parent: $parent, $crate::Level::ERROR, { $($k).+ $($field)+ }) + $crate::event!(name: $name, parent: $parent, $crate::Level::ERROR, { %$($k).+ $($field)+ }) ); (name: $name:expr, parent: $parent:expr, $($arg:tt)+ ) => ( $crate::event!(name: $name, parent: $parent, $crate::Level::ERROR, {}, $($arg)+) diff --git a/tracing/tests/macros.rs b/tracing/tests/macros.rs index b6e568f4a..e9966a546 100644 --- a/tracing/tests/macros.rs +++ b/tracing/tests/macros.rs @@ -10,6 +10,16 @@ use tracing::{ span, span_enabled, trace, trace_span, warn, warn_span, Level, }; +/// A type that implements `Display` and `Debug`, but not `Value`. +#[derive(Debug)] +struct DisplayDebug; + +impl ::std::fmt::Display for DisplayDebug { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::std::write!(f, "Foo") + } +} + // Tests that macros work across various invocation syntax. // // These are quite repetitive, and _could_ be generated by a macro. However, @@ -581,6 +591,19 @@ fn trace() { trace!(target: "foo_events", ?foo, true, "message"); trace!(target: "foo_events", %foo, true, "message"); trace!(target: "foo_events", foo, true, "message"); + let foo = DisplayDebug; + trace!(?foo); + trace!(%foo); + trace!(name: "foo", ?foo); + trace!(name: "foo", %foo); + trace!(name: "foo", ?foo, true, "message"); + trace!(name: "foo", %foo, true, "message"); + trace!(target: "foo_events", ?foo); + trace!(target: "foo_events", %foo); + trace!(target: "foo_events", ?foo, true, "message"); + trace!(target: "foo_events", %foo, true, "message"); + trace!(name: "foo", target: "foo_events", ?foo, true, "message"); + trace!(name: "foo", target: "foo_events", %foo, true, "message"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] @@ -625,6 +648,19 @@ fn debug() { debug!(target: "foo_events", ?foo, true, "message"); debug!(target: "foo_events", %foo, true, "message"); debug!(target: "foo_events", foo, true, "message"); + let foo = DisplayDebug; + debug!(?foo); + debug!(%foo); + debug!(name: "foo", ?foo); + debug!(name: "foo", %foo); + debug!(name: "foo", ?foo, true, "message"); + debug!(name: "foo", %foo, true, "message"); + debug!(target: "foo_events", ?foo); + debug!(target: "foo_events", %foo); + debug!(target: "foo_events", ?foo, true, "message"); + debug!(target: "foo_events", %foo, true, "message"); + debug!(name: "foo", target: "foo_events", ?foo, true, "message"); + debug!(name: "foo", target: "foo_events", %foo, true, "message"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] @@ -669,6 +705,19 @@ fn info() { info!(target: "foo_events", ?foo, true, "message"); info!(target: "foo_events", %foo, true, "message"); info!(target: "foo_events", foo, true, "message"); + let foo = DisplayDebug; + info!(?foo); + info!(%foo); + info!(name: "foo", ?foo); + info!(name: "foo", %foo); + info!(name: "foo", ?foo, true, "message"); + info!(name: "foo", %foo, true, "message"); + info!(target: "foo_events", ?foo); + info!(target: "foo_events", %foo); + info!(target: "foo_events", ?foo, true, "message"); + info!(target: "foo_events", %foo, true, "message"); + info!(name: "foo", target: "foo_events", ?foo, true, "message"); + info!(name: "foo", target: "foo_events", %foo, true, "message"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] @@ -713,6 +762,19 @@ fn warn() { warn!(target: "foo_events", ?foo, true, "message"); warn!(target: "foo_events", %foo, true, "message"); warn!(target: "foo_events", foo, true, "message"); + let foo = DisplayDebug; + warn!(?foo); + warn!(%foo); + warn!(name: "foo", ?foo); + warn!(name: "foo", %foo); + warn!(name: "foo", ?foo, true, "message"); + warn!(name: "foo", %foo, true, "message"); + warn!(target: "foo_events", ?foo); + warn!(target: "foo_events", %foo); + warn!(target: "foo_events", ?foo, true, "message"); + warn!(target: "foo_events", %foo, true, "message"); + warn!(name: "foo", target: "foo_events", ?foo, true, "message"); + warn!(name: "foo", target: "foo_events", %foo, true, "message"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] @@ -757,6 +819,19 @@ fn error() { error!(target: "foo_events", ?foo, true, "message"); error!(target: "foo_events", %foo, true, "message"); error!(target: "foo_events", foo, true, "message"); + let foo = DisplayDebug; + error!(?foo); + error!(%foo); + error!(name: "foo", ?foo); + error!(name: "foo", %foo); + error!(name: "foo", ?foo, true, "message"); + error!(name: "foo", %foo, true, "message"); + error!(target: "foo_events", ?foo); + error!(target: "foo_events", %foo); + error!(target: "foo_events", ?foo, true, "message"); + error!(target: "foo_events", %foo, true, "message"); + error!(name: "foo", target: "foo_events", ?foo, true, "message"); + error!(name: "foo", target: "foo_events", %foo, true, "message"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]