Struct tracing_bunyan_formatter::BunyanFormattingLayer [−][src]
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.
Implementations
impl<W: MakeWriter + 'static> BunyanFormattingLayer<W>
[src]
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 aWrite
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]
impl<S, W> Layer<S> for BunyanFormattingLayer<W> where
S: Subscriber + for<'a> LookupSpan<'a>,
W: MakeWriter + 'static,
[src]fn on_event(&self, event: &Event<'_>, ctx: Context<'_, S>)
[src]
fn new_span(&self, _attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, S>)
[src]
fn on_close(&self, id: Id, ctx: Context<'_, S>)
[src]
pub fn register_callsite(
&self,
metadata: &'static Metadata<'static>
) -> Interest
[src]
&self,
metadata: &'static Metadata<'static>
) -> Interest
pub fn enabled(&self, metadata: &Metadata<'_>, ctx: Context<'_, S>) -> bool
[src]
pub fn on_record(&self, _span: &Id, _values: &Record<'_>, _ctx: Context<'_, S>)
[src]
pub fn on_follows_from(&self, _span: &Id, _follows: &Id, _ctx: Context<'_, S>)
[src]
pub fn on_enter(&self, _id: &Id, _ctx: Context<'_, S>)
[src]
pub fn on_exit(&self, _id: &Id, _ctx: Context<'_, S>)
[src]
pub fn on_id_change(&self, _old: &Id, _new: &Id, _ctx: Context<'_, S>)
[src]
pub fn and_then<L>(self, layer: L) -> Layered<L, Self, S> where
L: Layer<S>,
[src]
L: Layer<S>,
pub fn with_subscriber(self, inner: S) -> Layered<Self, S, S>
[src]
Auto Trait Implementations
impl<W> RefUnwindSafe for BunyanFormattingLayer<W> where
W: RefUnwindSafe,
impl<W> RefUnwindSafe for BunyanFormattingLayer<W> where
W: RefUnwindSafe,
impl<W> Send for BunyanFormattingLayer<W> where
W: Send,
impl<W> Send for BunyanFormattingLayer<W> where
W: Send,
impl<W> Sync for BunyanFormattingLayer<W> where
W: Sync,
impl<W> Sync for BunyanFormattingLayer<W> where
W: Sync,
impl<W> Unpin for BunyanFormattingLayer<W> where
W: Unpin,
impl<W> Unpin for BunyanFormattingLayer<W> where
W: Unpin,
impl<W> UnwindSafe for BunyanFormattingLayer<W> where
W: UnwindSafe,
impl<W> UnwindSafe for BunyanFormattingLayer<W> where
W: UnwindSafe,
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]