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§

source

fn on_event<'a, R: LookupSpan<'a>>( &self, record: &mut Record, event: &Event<'_>, current_span: Option<SpanRef<'a, R>> )

Handler for when Layer::on_event is invoked.

Given record must be filled with data, after exiting this method, record is sent to the fluentd

Provided Methods§

source

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.

source

fn on_record<C: Collect + for<'a> LookupSpan<'a>>( &self, id: &Id, values: &Record<'_>, ctx: Context<'_, C> )

Handler for when Layer::new_span is invoked.

By default uses span’s extensions to store extra attributes of span within fluent::Map, created by new_span, if any.

Implementors§