[][src]Trait tracing_subscriber::fmt::FormatEvent

pub trait FormatEvent<S, N> where
    S: Subscriber + for<'a> LookupSpan<'a>,
    N: for<'a> FormatFields<'a> + 'static, 
{ fn format_event(
        &self,
        ctx: &FmtContext<'_, S, N>,
        writer: &mut dyn Write,
        event: &Event<'_>
    ) -> Result; }
This is supported on crate feature fmt only.

A type that can format a tracing Event for a fmt::Write.

FormatEvent is primarily used in the context of fmt::Subscriber or fmt::Layer. Each time an event is dispatched to fmt::Subscriber or fmt::Layer, the subscriber or layer forwards it to its associated FormatEvent to emit a log message.

This trait is already implemented for function pointers with the same signature as format_event.

Required methods

fn format_event(
    &self,
    ctx: &FmtContext<'_, S, N>,
    writer: &mut dyn Write,
    event: &Event<'_>
) -> Result

This is supported on crate feature fmt only.

Write a log message for Event in Context to the given Write.

Loading content...

Implementations on Foreign Types

impl<S, N> FormatEvent<S, N> for fn(ctx: &FmtContext<'_, S, N>, _: &mut dyn Write, _: &Event<'_>) -> Result where
    S: Subscriber + for<'a> LookupSpan<'a>,
    N: for<'a> FormatFields<'a> + 'static, 
[src]

Loading content...

Implementors

impl<S, N, T> FormatEvent<S, N> for Format<Compact, T> where
    S: Subscriber + for<'a> LookupSpan<'a>,
    N: for<'a> FormatFields<'a> + 'static,
    T: FormatTime
[src]

impl<S, N, T> FormatEvent<S, N> for Format<Full, T> where
    S: Subscriber + for<'a> LookupSpan<'a>,
    N: for<'a> FormatFields<'a> + 'static,
    T: FormatTime
[src]

impl<S, N, T> FormatEvent<S, N> for Format<Json, T> where
    S: Subscriber + for<'lookup> LookupSpan<'lookup>,
    N: for<'writer> FormatFields<'writer> + 'static,
    T: FormatTime
[src]

Loading content...