[][src]Struct tracing_bunyan_formatter::BunyanFormattingLayer

pub struct BunyanFormattingLayer<W: MakeWriter + 'static> { /* fields omitted */ }

This layer is exclusively concerned with formatting information using the Bunyan format. It relies on the upstream JsonStorageLayer to get access to the fields attached to each span.

Methods

impl<W: MakeWriter + 'static> BunyanFormattingLayer<W>[src]

pub fn new(name: String, make_writer: W) -> Self[src]

Create a new BunyanFormattingLayer.

You have to specify:

  • a name, which will be attached to all formatted records according to the Bunyan format;
  • a make_writer, which will be used to get a Write instance to write formatted records to.

Using stdout

use tracing_bunyan_formatter::BunyanFormattingLayer;

let formatting_layer = BunyanFormattingLayer::new("tracing_example".into(), std::io::stdout);

If you prefer, you can use closure syntax:

use tracing_bunyan_formatter::BunyanFormattingLayer;

let formatting_layer = BunyanFormattingLayer::new("tracing_example".into(), || std::io::stdout());

Trait Implementations

impl<S, W> Layer<S> for BunyanFormattingLayer<W> where
    S: Subscriber + for<'a> LookupSpan<'a>,
    W: MakeWriter + 'static, 
[src]

Auto Trait Implementations

impl<W> RefUnwindSafe for BunyanFormattingLayer<W> where
    W: RefUnwindSafe

impl<W> Send for BunyanFormattingLayer<W> where
    W: Send

impl<W> Sync for BunyanFormattingLayer<W> where
    W: Sync

impl<W> Unpin for BunyanFormattingLayer<W> where
    W: Unpin

impl<W> UnwindSafe for BunyanFormattingLayer<W> where
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.