🛈 Note: This is pre-release documentation for the upcoming tracing 0.2.0 ecosystem.

For the release documentation, please see docs.rs, instead.

Macro record_all

Source
macro_rules! record_all {
    ($span:expr, $($fields:tt)*) => { ... };
}
Expand description

Records multiple values on a span in a single call. As with recording individual values, all fields must be declared when the span is created.

This macro supports two optional sigils:

  • % uses the Display implementation.
  • ? uses the Debug implementation.

For more details, see the top-level documentation.

§Examples

let span = info_span!("my span", field1 = field::Empty, field2 = field::Empty, field3 = field::Empty).entered();
record_all!(span, field1 = ?"1", field2 = %"2", field3 = 3);