diff options
Diffstat (limited to '')
-rw-r--r-- | vendor/tracing/tests/macros.rs | 624 |
1 files changed, 466 insertions, 158 deletions
diff --git a/vendor/tracing/tests/macros.rs b/vendor/tracing/tests/macros.rs index a9679a3e9..81b929d1d 100644 --- a/vendor/tracing/tests/macros.rs +++ b/vendor/tracing/tests/macros.rs @@ -1,4 +1,14 @@ #![deny(warnings)] +// We call all macros in this module with `no_implicit_prelude` to ensure they do not depend on the standard prelude. +#![no_implicit_prelude] +extern crate tracing; +#[cfg(target_arch = "wasm32")] +extern crate wasm_bindgen_test; + +// TODO: remove this once https://github.com/tokio-rs/tracing/pull/2675#issuecomment-1667628907 is resolved +#[cfg(target_arch = "wasm32")] +use ::core::option::Option::None; + use tracing::{ callsite, debug, debug_span, enabled, error, error_span, event, event_enabled, info, info_span, span, span_enabled, trace, trace_span, warn, warn_span, Level, @@ -111,80 +121,142 @@ fn error_span() { #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn span_root() { - span!(target: "foo_events", parent: None, Level::TRACE, "foo", bar.baz = 2, quux = 3); - span!(target: "foo_events", parent: None, Level::TRACE, "foo", bar.baz = 2, quux = 3); - span!(target: "foo_events", parent: None, Level::TRACE, "foo", bar.baz = 2, quux = 4,); - span!(target: "foo_events", parent: None, Level::TRACE, "foo"); - span!(target: "foo_events", parent: None, Level::TRACE, "bar",); - span!(parent: None, Level::DEBUG, "foo", bar.baz = 2, quux = 3); - span!(parent: None, Level::DEBUG, "foo", bar.baz = 2, quux = 4,); - span!(parent: None, Level::DEBUG, "foo"); - span!(parent: None, Level::DEBUG, "bar",); + span!(target: "foo_events", parent: ::core::option::Option::None, Level::TRACE, "foo", bar.baz = 2, quux = 3); + span!(target: "foo_events", parent: ::core::option::Option::None, Level::TRACE, "foo", bar.baz = 2, quux = 3); + span!(target: "foo_events", parent: ::core::option::Option::None, Level::TRACE, "foo", bar.baz = 2, quux = 4,); + span!(target: "foo_events", parent: ::core::option::Option::None, Level::TRACE, "foo"); + span!(target: "foo_events", parent: ::core::option::Option::None, Level::TRACE, "bar",); + span!( + parent: ::core::option::Option::None, + Level::DEBUG, + "foo", + bar.baz = 2, + quux = 3 + ); + span!( + parent: ::core::option::Option::None, + Level::DEBUG, + "foo", + bar.baz = 2, + quux = 4, + ); + span!(parent: ::core::option::Option::None, Level::DEBUG, "foo"); + span!(parent: ::core::option::Option::None, Level::DEBUG, "bar",); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn trace_span_root() { - trace_span!(target: "foo_events", parent: None, "foo", bar.baz = 2, quux = 3); - trace_span!(target: "foo_events", parent: None, "foo", bar.baz = 2, quux = 4,); - trace_span!(target: "foo_events", parent: None, "foo"); - trace_span!(target: "foo_events", parent: None, "bar",); - trace_span!(parent: None, "foo", bar.baz = 2, quux = 3); - trace_span!(parent: None, "foo", bar.baz = 2, quux = 4,); - trace_span!(parent: None, "foo"); - trace_span!(parent: None, "bar",); + trace_span!(target: "foo_events", parent: ::core::option::Option::None, "foo", bar.baz = 2, quux = 3); + trace_span!(target: "foo_events", parent: ::core::option::Option::None, "foo", bar.baz = 2, quux = 4,); + trace_span!(target: "foo_events", parent: ::core::option::Option::None, "foo"); + trace_span!(target: "foo_events", parent: ::core::option::Option::None, "bar",); + trace_span!( + parent: ::core::option::Option::None, + "foo", + bar.baz = 2, + quux = 3 + ); + trace_span!( + parent: ::core::option::Option::None, + "foo", + bar.baz = 2, + quux = 4, + ); + trace_span!(parent: ::core::option::Option::None, "foo"); + trace_span!(parent: ::core::option::Option::None, "bar",); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn debug_span_root() { - debug_span!(target: "foo_events", parent: None, "foo", bar.baz = 2, quux = 3); - debug_span!(target: "foo_events", parent: None, "foo", bar.baz = 2, quux = 4,); - debug_span!(target: "foo_events", parent: None, "foo"); - debug_span!(target: "foo_events", parent: None, "bar",); - debug_span!(parent: None, "foo", bar.baz = 2, quux = 3); - debug_span!(parent: None, "foo", bar.baz = 2, quux = 4,); - debug_span!(parent: None, "foo"); - debug_span!(parent: None, "bar",); + debug_span!(target: "foo_events", parent: ::core::option::Option::None, "foo", bar.baz = 2, quux = 3); + debug_span!(target: "foo_events", parent: ::core::option::Option::None, "foo", bar.baz = 2, quux = 4,); + debug_span!(target: "foo_events", parent: ::core::option::Option::None, "foo"); + debug_span!(target: "foo_events", parent: ::core::option::Option::None, "bar",); + debug_span!( + parent: ::core::option::Option::None, + "foo", + bar.baz = 2, + quux = 3 + ); + debug_span!( + parent: ::core::option::Option::None, + "foo", + bar.baz = 2, + quux = 4, + ); + debug_span!(parent: ::core::option::Option::None, "foo"); + debug_span!(parent: ::core::option::Option::None, "bar",); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn info_span_root() { - info_span!(target: "foo_events", parent: None, "foo", bar.baz = 2, quux = 3); - info_span!(target: "foo_events", parent: None, "foo", bar.baz = 2, quux = 4,); - info_span!(target: "foo_events", parent: None, "foo"); - info_span!(target: "foo_events", parent: None, "bar",); - info_span!(parent: None, "foo", bar.baz = 2, quux = 3); - info_span!(parent: None, "foo", bar.baz = 2, quux = 4,); - info_span!(parent: None, "foo"); - info_span!(parent: None, "bar",); + info_span!(target: "foo_events", parent: ::core::option::Option::None, "foo", bar.baz = 2, quux = 3); + info_span!(target: "foo_events", parent: ::core::option::Option::None, "foo", bar.baz = 2, quux = 4,); + info_span!(target: "foo_events", parent: ::core::option::Option::None, "foo"); + info_span!(target: "foo_events", parent: ::core::option::Option::None, "bar",); + info_span!( + parent: ::core::option::Option::None, + "foo", + bar.baz = 2, + quux = 3 + ); + info_span!( + parent: ::core::option::Option::None, + "foo", + bar.baz = 2, + quux = 4, + ); + info_span!(parent: ::core::option::Option::None, "foo"); + info_span!(parent: ::core::option::Option::None, "bar",); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn warn_span_root() { - warn_span!(target: "foo_events", parent: None, "foo", bar.baz = 2, quux = 3); - warn_span!(target: "foo_events", parent: None, "foo", bar.baz = 2, quux = 4,); - warn_span!(target: "foo_events", parent: None, "foo"); - warn_span!(target: "foo_events", parent: None, "bar",); - warn_span!(parent: None, "foo", bar.baz = 2, quux = 3); - warn_span!(parent: None, "foo", bar.baz = 2, quux = 4,); - warn_span!(parent: None, "foo"); - warn_span!(parent: None, "bar",); + warn_span!(target: "foo_events", parent: ::core::option::Option::None, "foo", bar.baz = 2, quux = 3); + warn_span!(target: "foo_events", parent: ::core::option::Option::None, "foo", bar.baz = 2, quux = 4,); + warn_span!(target: "foo_events", parent: ::core::option::Option::None, "foo"); + warn_span!(target: "foo_events", parent: ::core::option::Option::None, "bar",); + warn_span!( + parent: ::core::option::Option::None, + "foo", + bar.baz = 2, + quux = 3 + ); + warn_span!( + parent: ::core::option::Option::None, + "foo", + bar.baz = 2, + quux = 4, + ); + warn_span!(parent: ::core::option::Option::None, "foo"); + warn_span!(parent: ::core::option::Option::None, "bar",); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn error_span_root() { - error_span!(target: "foo_events", parent: None, "foo", bar.baz = 2, quux = 3); - error_span!(target: "foo_events", parent: None, "foo", bar.baz = 2, quux = 4,); - error_span!(target: "foo_events", parent: None, "foo"); - error_span!(target: "foo_events", parent: None, "bar",); - error_span!(parent: None, "foo", bar.baz = 2, quux = 3); - error_span!(parent: None, "foo", bar.baz = 2, quux = 4,); - error_span!(parent: None, "foo"); - error_span!(parent: None, "bar",); + error_span!(target: "foo_events", parent: ::core::option::Option::None, "foo", bar.baz = 2, quux = 3); + error_span!(target: "foo_events", parent: ::core::option::Option::None, "foo", bar.baz = 2, quux = 4,); + error_span!(target: "foo_events", parent: ::core::option::Option::None, "foo"); + error_span!(target: "foo_events", parent: ::core::option::Option::None, "bar",); + error_span!( + parent: ::core::option::Option::None, + "foo", + bar.baz = 2, + quux = 3 + ); + error_span!( + parent: ::core::option::Option::None, + "foo", + bar.baz = 2, + quux = 4, + ); + error_span!(parent: ::core::option::Option::None, "foo"); + error_span!(parent: ::core::option::Option::None, "bar",); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] @@ -300,6 +372,48 @@ fn span_with_non_rust_symbol() { #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] +fn large_span() { + span!( + Level::TRACE, + "spans with more than 32 fields have been supported since #2508", + a = 1, + b = 2, + c = 3, + d = 4, + e = 5, + f = 6, + g = 7, + h = 8, + i = 9, + j = 10, + k = 11, + l = 12, + m = 13, + n = 14, + o = 15, + p = 16, + q = 17, + r = 18, + s = 19, + t = 20, + u = 21, + v = 22, + w = 23, + x = 24, + y = 25, + z = 26, + aa = 27, + bb = 28, + cc = 29, + dd = 30, + ee = 31, + ff = 32, + gg = 33 + ); +} + +#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] +#[test] fn event() { event!(Level::DEBUG, foo = ?3, bar.baz = %2, quux = false); event!(Level::DEBUG, foo = 3, bar.baz = 2, quux = false); @@ -400,6 +514,13 @@ fn locals_no_message() { let private_data = "private"; let error = "a bad error"; event!( + name: "foo", + target: "app_events", + Level::WARN, + private_data, + ?data, + ); + event!( target: "app_events", Level::WARN, private_data, @@ -438,6 +559,8 @@ fn trace() { trace!({ foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); trace!({ foo = 2, bar.baz = 78 }, "quux"); trace!({ foo = ?2, bar.baz = %78 }, "quux"); + trace!(name: "foo", foo = 3, bar.baz = 2, quux = false); + trace!(name: "foo", target: "foo_events", foo = 3, bar.baz = 2, quux = false); trace!(target: "foo_events", foo = 3, bar.baz = 2, quux = false); trace!(target: "foo_events", foo = 3, bar.baz = 3,); trace!(target: "foo_events", "foo"); @@ -450,6 +573,12 @@ fn trace() { trace!(?foo); trace!(%foo); trace!(foo); + trace!(name: "foo", ?foo); + trace!(name: "foo", %foo); + trace!(name: "foo", foo); + trace!(name: "foo", ?foo, true, "message"); + 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); @@ -474,6 +603,8 @@ fn debug() { debug!({ foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); debug!({ foo = 2, bar.baz = 78 }, "quux"); debug!({ foo = ?2, bar.baz = %78 }, "quux"); + debug!(name: "foo", foo = 3, bar.baz = 2, quux = false); + debug!(name: "foo", target: "foo_events", foo = 3, bar.baz = 2, quux = false); debug!(target: "foo_events", foo = 3, bar.baz = 2, quux = false); debug!(target: "foo_events", foo = 3, bar.baz = 3,); debug!(target: "foo_events", "foo"); @@ -486,6 +617,12 @@ fn debug() { debug!(?foo); debug!(%foo); debug!(foo); + debug!(name: "foo", ?foo); + debug!(name: "foo", %foo); + debug!(name: "foo", foo); + debug!(name: "foo", ?foo, true, "message"); + 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); @@ -510,6 +647,8 @@ fn info() { info!({ foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); info!({ foo = 2, bar.baz = 78 }, "quux"); info!({ foo = ?2, bar.baz = %78 }, "quux"); + info!(name: "foo", foo = 3, bar.baz = 2, quux = false); + info!(name: "foo", target: "foo_events", foo = 3, bar.baz = 2, quux = false); info!(target: "foo_events", foo = 3, bar.baz = 2, quux = false); info!(target: "foo_events", foo = 3, bar.baz = 3,); info!(target: "foo_events", "foo"); @@ -522,6 +661,12 @@ fn info() { info!(?foo); info!(%foo); info!(foo); + info!(name: "foo", ?foo); + info!(name: "foo", %foo); + info!(name: "foo", foo); + info!(name: "foo", ?foo, true, "message"); + 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); @@ -546,6 +691,8 @@ fn warn() { warn!({ foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); warn!({ foo = 2, bar.baz = 78 }, "quux"); warn!({ foo = ?2, bar.baz = %78 }, "quux"); + warn!(name: "foo", foo = 3, bar.baz = 2, quux = false); + warn!(name: "foo", target: "foo_events", foo = 3, bar.baz = 2, quux = false); warn!(target: "foo_events", foo = 3, bar.baz = 2, quux = false); warn!(target: "foo_events", foo = 3, bar.baz = 3,); warn!(target: "foo_events", "foo"); @@ -558,6 +705,12 @@ fn warn() { warn!(?foo); warn!(%foo); warn!(foo); + warn!(name: "foo", ?foo); + warn!(name: "foo", %foo); + warn!(name: "foo", foo); + warn!(name: "foo", ?foo, true, "message"); + 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); @@ -582,6 +735,8 @@ fn error() { error!({ foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); error!({ foo = 2, bar.baz = 78, }, "quux"); error!({ foo = ?2, bar.baz = %78 }, "quux"); + error!(name: "foo", foo = 3, bar.baz = 2, quux = false); + error!(name: "foo", target: "foo_events", foo = 3, bar.baz = 2, quux = false); error!(target: "foo_events", foo = 3, bar.baz = 2, quux = false); error!(target: "foo_events", foo = 3, bar.baz = 3,); error!(target: "foo_events", "foo"); @@ -594,6 +749,12 @@ fn error() { error!(?foo); error!(%foo); error!(foo); + error!(name: "foo", ?foo); + error!(name: "foo", %foo); + error!(name: "foo", foo); + error!(name: "foo", ?foo, true, "message"); + 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); @@ -605,144 +766,227 @@ fn error() { #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn event_root() { - event!(parent: None, Level::DEBUG, foo = ?3, bar.baz = %2, quux = false); + event!(parent: ::core::option::Option::None, Level::DEBUG, foo = ?3, bar.baz = %2, quux = false); event!( - parent: None, + parent: ::core::option::Option::None, Level::DEBUG, foo = 3, bar.baz = 2, quux = false ); - event!(parent: None, Level::DEBUG, foo = 3, bar.baz = 3,); - event!(parent: None, Level::DEBUG, "foo"); - event!(parent: None, Level::DEBUG, "foo: {}", 3); - event!(parent: None, Level::DEBUG, { foo = 3, bar.baz = 80 }, "quux"); - event!(parent: None, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}", true); - event!(parent: None, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); - event!(parent: None, Level::DEBUG, { foo = ?2, bar.baz = %78 }, "quux"); - event!(target: "foo_events", parent: None, Level::DEBUG, foo = 3, bar.baz = 2, quux = false); - event!(target: "foo_events", parent: None, Level::DEBUG, foo = 3, bar.baz = 3,); - event!(target: "foo_events", parent: None, Level::DEBUG, "foo"); - event!(target: "foo_events", parent: None, Level::DEBUG, "foo: {}", 3); - event!(target: "foo_events", parent: None, Level::DEBUG, { foo = 3, bar.baz = 80 }, "quux"); - event!(target: "foo_events", parent: None, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}", true); - event!(target: "foo_events", parent: None, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); - event!(target: "foo_events", parent: None, Level::DEBUG, { foo = 2, bar.baz = 78, }, "quux"); + event!( + parent: ::core::option::Option::None, + Level::DEBUG, + foo = 3, + bar.baz = 3, + ); + event!(parent: ::core::option::Option::None, Level::DEBUG, "foo"); + event!( + parent: ::core::option::Option::None, + Level::DEBUG, + "foo: {}", + 3 + ); + event!(parent: ::core::option::Option::None, Level::DEBUG, { foo = 3, bar.baz = 80 }, "quux"); + event!(parent: ::core::option::Option::None, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + event!(parent: ::core::option::Option::None, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + event!(parent: ::core::option::Option::None, Level::DEBUG, { foo = ?2, bar.baz = %78 }, "quux"); + event!(target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, foo = 3, bar.baz = 2, quux = false); + event!(target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, foo = 3, bar.baz = 3,); + event!(target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, "foo"); + event!(target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, "foo: {}", 3); + event!(target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, { foo = 3, bar.baz = 80 }, "quux"); + event!(target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + event!(target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + event!(target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, { foo = 2, bar.baz = 78, }, "quux"); + event!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, foo = 3, bar.baz = 2, quux = false); + event!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, foo = 3, bar.baz = 3,); + event!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, "foo"); + event!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, "foo: {}", 3); + event!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, { foo = 3, bar.baz = 80 }, "quux"); + event!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + event!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + event!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, Level::DEBUG, { foo = 2, bar.baz = 78, }, "quux"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn trace_root() { - trace!(parent: None, foo = ?3, bar.baz = %2, quux = false); - trace!(parent: None, foo = 3, bar.baz = 2, quux = false); - trace!(parent: None, foo = 3, bar.baz = 3,); - trace!(parent: None, "foo"); - trace!(parent: None, "foo: {}", 3); - trace!(parent: None, { foo = 3, bar.baz = 80 }, "quux"); - trace!(parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); - trace!(parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); - trace!(parent: None, { foo = 2, bar.baz = 78 }, "quux"); - trace!(parent: None, { foo = ?2, bar.baz = %78 }, "quux"); - trace!(target: "foo_events", parent: None, foo = 3, bar.baz = 2, quux = false); - trace!(target: "foo_events", parent: None, foo = 3, bar.baz = 3,); - trace!(target: "foo_events", parent: None, "foo"); - trace!(target: "foo_events", parent: None, "foo: {}", 3); - trace!(target: "foo_events", parent: None, { foo = 3, bar.baz = 80 }, "quux"); - trace!(target: "foo_events", parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); - trace!(target: "foo_events", parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); - trace!(target: "foo_events", parent: None, { foo = 2, bar.baz = 78, }, "quux"); + trace!(parent: ::core::option::Option::None, foo = ?3, bar.baz = %2, quux = false); + trace!( + parent: ::core::option::Option::None, + foo = 3, + bar.baz = 2, + quux = false + ); + trace!(parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + trace!(parent: ::core::option::Option::None, "foo"); + trace!(parent: ::core::option::Option::None, "foo: {}", 3); + trace!(parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + trace!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + trace!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + trace!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 78 }, "quux"); + trace!(parent: ::core::option::Option::None, { foo = ?2, bar.baz = %78 }, "quux"); + trace!(target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 2, quux = false); + trace!(target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + trace!(target: "foo_events", parent: ::core::option::Option::None, "foo"); + trace!(target: "foo_events", parent: ::core::option::Option::None, "foo: {}", 3); + trace!(target: "foo_events", parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + trace!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + trace!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + trace!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 78, }, "quux"); + trace!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 2, quux = false); + trace!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + trace!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, "foo"); + trace!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, "foo: {}", 3); + trace!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + trace!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + trace!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + trace!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 78, }, "quux"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn debug_root() { - debug!(parent: None, foo = ?3, bar.baz = %2, quux = false); - debug!(parent: None, foo = 3, bar.baz = 2, quux = false); - debug!(parent: None, foo = 3, bar.baz = 3,); - debug!(parent: None, "foo"); - debug!(parent: None, "foo: {}", 3); - debug!(parent: None, { foo = 3, bar.baz = 80 }, "quux"); - debug!(parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); - debug!(parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); - debug!(parent: None, { foo = 2, bar.baz = 78 }, "quux"); - debug!(parent: None, { foo = ?2, bar.baz = %78 }, "quux"); - debug!(target: "foo_events", parent: None, foo = 3, bar.baz = 2, quux = false); - debug!(target: "foo_events", parent: None, foo = 3, bar.baz = 3,); - debug!(target: "foo_events", parent: None, "foo"); - debug!(target: "foo_events", parent: None, "foo: {}", 3); - debug!(target: "foo_events", parent: None, { foo = 3, bar.baz = 80 }, "quux"); - debug!(target: "foo_events", parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); - debug!(target: "foo_events", parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); - debug!(target: "foo_events", parent: None, { foo = 2, bar.baz = 78, }, "quux"); + debug!(parent: ::core::option::Option::None, foo = ?3, bar.baz = %2, quux = false); + debug!( + parent: ::core::option::Option::None, + foo = 3, + bar.baz = 2, + quux = false + ); + debug!(parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + debug!(parent: ::core::option::Option::None, "foo"); + debug!(parent: ::core::option::Option::None, "foo: {}", 3); + debug!(parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + debug!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + debug!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + debug!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 78 }, "quux"); + debug!(parent: ::core::option::Option::None, { foo = ?2, bar.baz = %78 }, "quux"); + debug!(target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 2, quux = false); + debug!(target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + debug!(target: "foo_events", parent: ::core::option::Option::None, "foo"); + debug!(target: "foo_events", parent: ::core::option::Option::None, "foo: {}", 3); + debug!(target: "foo_events", parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + debug!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + debug!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + debug!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 78, }, "quux"); + debug!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 2, quux = false); + debug!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + debug!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, "foo"); + debug!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, "foo: {}", 3); + debug!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + debug!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + debug!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + debug!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 78, }, "quux"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn info_root() { - info!(parent: None, foo = ?3, bar.baz = %2, quux = false); - info!(parent: None, foo = 3, bar.baz = 2, quux = false); - info!(parent: None, foo = 3, bar.baz = 3,); - info!(parent: None, "foo"); - info!(parent: None, "foo: {}", 3); - info!(parent: None, { foo = 3, bar.baz = 80 }, "quux"); - info!(parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); - info!(parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); - info!(parent: None, { foo = 2, bar.baz = 78 }, "quux"); - info!(parent: None, { foo = ?2, bar.baz = %78 }, "quux"); - info!(target: "foo_events", parent: None, foo = 3, bar.baz = 2, quux = false); - info!(target: "foo_events", parent: None, foo = 3, bar.baz = 3,); - info!(target: "foo_events", parent: None, "foo"); - info!(target: "foo_events", parent: None, "foo: {}", 3); - info!(target: "foo_events", parent: None, { foo = 3, bar.baz = 80 }, "quux"); - info!(target: "foo_events", parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); - info!(target: "foo_events", parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); - info!(target: "foo_events", parent: None, { foo = 2, bar.baz = 78, }, "quux"); + info!(parent: ::core::option::Option::None, foo = ?3, bar.baz = %2, quux = false); + info!( + parent: ::core::option::Option::None, + foo = 3, + bar.baz = 2, + quux = false + ); + info!(parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + info!(parent: ::core::option::Option::None, "foo"); + info!(parent: ::core::option::Option::None, "foo: {}", 3); + info!(parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + info!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + info!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + info!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 78 }, "quux"); + info!(parent: ::core::option::Option::None, { foo = ?2, bar.baz = %78 }, "quux"); + info!(target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 2, quux = false); + info!(target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + info!(target: "foo_events", parent: ::core::option::Option::None, "foo"); + info!(target: "foo_events", parent: ::core::option::Option::None, "foo: {}", 3); + info!(target: "foo_events", parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + info!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + info!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + info!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 78, }, "quux"); + info!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 2, quux = false); + info!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + info!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, "foo"); + info!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, "foo: {}", 3); + info!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + info!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + info!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + info!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 78, }, "quux"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn warn_root() { - warn!(parent: None, foo = ?3, bar.baz = %2, quux = false); - warn!(parent: None, foo = 3, bar.baz = 2, quux = false); - warn!(parent: None, foo = 3, bar.baz = 3,); - warn!(parent: None, "foo"); - warn!(parent: None, "foo: {}", 3); - warn!(parent: None, { foo = 3, bar.baz = 80 }, "quux"); - warn!(parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); - warn!(parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); - warn!(parent: None, { foo = 2, bar.baz = 78 }, "quux"); - warn!(parent: None, { foo = ?2, bar.baz = %78 }, "quux"); - warn!(target: "foo_events", parent: None, foo = 3, bar.baz = 2, quux = false); - warn!(target: "foo_events", parent: None, foo = 3, bar.baz = 3,); - warn!(target: "foo_events", parent: None, "foo"); - warn!(target: "foo_events", parent: None, "foo: {}", 3); - warn!(target: "foo_events", parent: None, { foo = 3, bar.baz = 80 }, "quux"); - warn!(target: "foo_events", parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); - warn!(target: "foo_events", parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); - warn!(target: "foo_events", parent: None, { foo = 2, bar.baz = 78, }, "quux"); + warn!(parent: ::core::option::Option::None, foo = ?3, bar.baz = %2, quux = false); + warn!( + parent: ::core::option::Option::None, + foo = 3, + bar.baz = 2, + quux = false + ); + warn!(parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + warn!(parent: ::core::option::Option::None, "foo"); + warn!(parent: ::core::option::Option::None, "foo: {}", 3); + warn!(parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + warn!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + warn!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + warn!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 78 }, "quux"); + warn!(parent: ::core::option::Option::None, { foo = ?2, bar.baz = %78 }, "quux"); + warn!(target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 2, quux = false); + warn!(target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + warn!(target: "foo_events", parent: ::core::option::Option::None, "foo"); + warn!(target: "foo_events", parent: ::core::option::Option::None, "foo: {}", 3); + warn!(target: "foo_events", parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + warn!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + warn!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + warn!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 78, }, "quux"); + warn!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 2, quux = false); + warn!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + warn!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, "foo"); + warn!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, "foo: {}", 3); + warn!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + warn!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + warn!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + warn!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 78, }, "quux"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn error_root() { - error!(parent: None, foo = ?3, bar.baz = %2, quux = false); - error!(parent: None, foo = 3, bar.baz = 2, quux = false); - error!(parent: None, foo = 3, bar.baz = 3,); - error!(parent: None, "foo"); - error!(parent: None, "foo: {}", 3); - error!(parent: None, { foo = 3, bar.baz = 80 }, "quux"); - error!(parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); - error!(parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); - error!(parent: None, { foo = 2, bar.baz = 78 }, "quux"); - error!(parent: None, { foo = ?2, bar.baz = %78 }, "quux"); - error!(target: "foo_events", parent: None, foo = 3, bar.baz = 2, quux = false); - error!(target: "foo_events", parent: None, foo = 3, bar.baz = 3,); - error!(target: "foo_events", parent: None, "foo"); - error!(target: "foo_events", parent: None, "foo: {}", 3); - error!(target: "foo_events", parent: None, { foo = 3, bar.baz = 80 }, "quux"); - error!(target: "foo_events", parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); - error!(target: "foo_events", parent: None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); - error!(target: "foo_events", parent: None, { foo = 2, bar.baz = 78, }, "quux"); + error!(parent: ::core::option::Option::None, foo = ?3, bar.baz = %2, quux = false); + error!( + parent: ::core::option::Option::None, + foo = 3, + bar.baz = 2, + quux = false + ); + error!(parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + error!(parent: ::core::option::Option::None, "foo"); + error!(parent: ::core::option::Option::None, "foo: {}", 3); + error!(parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + error!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + error!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + error!(parent: ::core::option::Option::None, { foo = 2, bar.baz = 78 }, "quux"); + error!(parent: ::core::option::Option::None, { foo = ?2, bar.baz = %78 }, "quux"); + error!(target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 2, quux = false); + error!(target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + error!(target: "foo_events", parent: ::core::option::Option::None, "foo"); + error!(target: "foo_events", parent: ::core::option::Option::None, "foo: {}", 3); + error!(target: "foo_events", parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + error!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + error!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + error!(target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 78, }, "quux"); + error!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 2, quux = false); + error!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, foo = 3, bar.baz = 3,); + error!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, "foo"); + error!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, "foo: {}", 3); + error!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 3, bar.baz = 80 }, "quux"); + error!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + error!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + error!(name: "foo", target: "foo_events", parent: ::core::option::Option::None, { foo = 2, bar.baz = 78, }, "quux"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] @@ -766,6 +1010,14 @@ fn event_with_parent() { event!(target: "foo_events", parent: &p, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}", true); event!(target: "foo_events", parent: &p, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); event!(target: "foo_events", parent: &p, Level::DEBUG, { foo = 2, bar.baz = 78, }, "quux"); + event!(name: "foo", target: "foo_events", parent: &p, Level::DEBUG, foo = 3, bar.baz = 2, quux = false); + event!(name: "foo", target: "foo_events", parent: &p, Level::DEBUG, foo = 3, bar.baz = 3,); + event!(name: "foo", target: "foo_events", parent: &p, Level::DEBUG, "foo"); + event!(name: "foo", target: "foo_events", parent: &p, Level::DEBUG, "foo: {}", 3); + event!(name: "foo", target: "foo_events", parent: &p, Level::DEBUG, { foo = 3, bar.baz = 80 }, "quux"); + event!(name: "foo", target: "foo_events", parent: &p, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + event!(name: "foo", target: "foo_events", parent: &p, Level::DEBUG, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + event!(name: "foo", target: "foo_events", parent: &p, Level::DEBUG, { foo = 2, bar.baz = 78, }, "quux"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] @@ -790,6 +1042,14 @@ fn trace_with_parent() { trace!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}", true); trace!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); trace!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 78, }, "quux"); + trace!(name: "foo", target: "foo_events", parent: &p, foo = 3, bar.baz = 2, quux = false); + trace!(name: "foo", target: "foo_events", parent: &p, foo = 3, bar.baz = 3,); + trace!(name: "foo", target: "foo_events", parent: &p, "foo"); + trace!(name: "foo", target: "foo_events", parent: &p, "foo: {}", 3); + trace!(name: "foo", target: "foo_events", parent: &p, { foo = 3, bar.baz = 80 }, "quux"); + trace!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + trace!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + trace!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 78, }, "quux"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] @@ -814,6 +1074,14 @@ fn debug_with_parent() { debug!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}", true); debug!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); debug!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 78, }, "quux"); + debug!(name: "foo", target: "foo_events", parent: &p, foo = 3, bar.baz = 2, quux = false); + debug!(name: "foo", target: "foo_events", parent: &p, foo = 3, bar.baz = 3,); + debug!(name: "foo", target: "foo_events", parent: &p, "foo"); + debug!(name: "foo", target: "foo_events", parent: &p, "foo: {}", 3); + debug!(name: "foo", target: "foo_events", parent: &p, { foo = 3, bar.baz = 80 }, "quux"); + debug!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + debug!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + debug!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 78, }, "quux"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] @@ -838,6 +1106,14 @@ fn info_with_parent() { info!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}", true); info!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); info!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 78, }, "quux"); + info!(name: "foo", target: "foo_events", parent: &p, foo = 3, bar.baz = 2, quux = false); + info!(name: "foo", target: "foo_events", parent: &p, foo = 3, bar.baz = 3,); + info!(name: "foo", target: "foo_events", parent: &p, "foo"); + info!(name: "foo", target: "foo_events", parent: &p, "foo: {}", 3); + info!(name: "foo", target: "foo_events", parent: &p, { foo = 3, bar.baz = 80 }, "quux"); + info!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + info!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + info!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 78, }, "quux"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] @@ -862,6 +1138,14 @@ fn warn_with_parent() { warn!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}", true); warn!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); warn!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 78, }, "quux"); + warn!(name: "foo", target: "foo_events", parent: &p, foo = 3, bar.baz = 2, quux = false); + warn!(name: "foo", target: "foo_events", parent: &p, foo = 3, bar.baz = 3,); + warn!(name: "foo", target: "foo_events", parent: &p, "foo"); + warn!(name: "foo", target: "foo_events", parent: &p, "foo: {}", 3); + warn!(name: "foo", target: "foo_events", parent: &p, { foo = 3, bar.baz = 80 }, "quux"); + warn!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + warn!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + warn!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 78, }, "quux"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] @@ -886,6 +1170,14 @@ fn error_with_parent() { error!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}", true); error!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); error!(target: "foo_events", parent: &p, { foo = 2, bar.baz = 78, }, "quux"); + error!(name: "foo", target: "foo_events", parent: &p, foo = 3, bar.baz = 2, quux = false); + error!(name: "foo", target: "foo_events", parent: &p, foo = 3, bar.baz = 3,); + error!(name: "foo", target: "foo_events", parent: &p, "foo"); + error!(name: "foo", target: "foo_events", parent: &p, "foo: {}", 3); + error!(name: "foo", target: "foo_events", parent: &p, { foo = 3, bar.baz = 80 }, "quux"); + error!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}", true); + error!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 79 }, "quux {:?}, {quux}", true, quux = false); + error!(name: "foo", target: "foo_events", parent: &p, { foo = 2, bar.baz = 78, }, "quux"); } #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] @@ -913,7 +1205,7 @@ fn field_shorthand_only() { #[test] fn borrow_val_events() { // Reproduces https://github.com/tokio-rs/tracing/issues/954 - let mut foo = (String::new(), String::new()); + let mut foo = (::std::string::String::new(), ::std::string::String::new()); let zero = &mut foo.0; trace!(one = ?foo.1); debug!(one = ?foo.1); @@ -927,7 +1219,7 @@ fn borrow_val_events() { #[test] fn borrow_val_spans() { // Reproduces https://github.com/tokio-rs/tracing/issues/954 - let mut foo = (String::new(), String::new()); + let mut foo = (::std::string::String::new(), ::std::string::String::new()); let zero = &mut foo.0; let _span = trace_span!("span", one = ?foo.1); let _span = debug_span!("span", one = ?foo.1); @@ -961,3 +1253,19 @@ fn callsite_macro_api() { fields: foo, }; } + +#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] +#[test] +fn format_args_already_defined() { + // Reproduces: https://github.com/tokio-rs/tracing/issues/2721 + #[allow(unused)] + macro_rules! format_args { + ($i:expr) => {}; + } + event!(Level::DEBUG, "foo: {}", 3); + trace!("foo: {}", 3); + debug!("foo: {}", 3); + info!("foo: {}", 3); + warn!("foo: {}", 3); + error!("foo: {}", 3); +} |