pub trait FieldFormatter: 'static {
// Required method
fn on_event<'a, R: LookupSpan<'a>>(
&self,
record: &mut Record,
event: &Event<'_>,
current_span: Option<SpanRef<'a, R>>,
);
// Provided methods
fn on_new_span<C: Collect + for<'a> LookupSpan<'a>>(
&self,
attrs: &Attributes<'_>,
id: &Id,
ctx: Context<'_, C>,
) { ... }
fn on_record<C: Collect + for<'a> LookupSpan<'a>>(
&self,
id: &Id,
values: &Record<'_>,
ctx: Context<'_, C>,
) { ... }
}
Expand description
Describes how compose event fields.
Required Methods§
Provided Methods§
Sourcefn on_new_span<C: Collect + for<'a> LookupSpan<'a>>(
&self,
attrs: &Attributes<'_>,
id: &Id,
ctx: Context<'_, C>,
)
fn on_new_span<C: Collect + for<'a> LookupSpan<'a>>( &self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, C>, )
Handler for when Layer::new_span
is invoked.
By default uses span’s extensions to store fluent::Map
containing attributes of the span.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.