[−][src]Struct tracing_bunyan_formatter::BunyanFormattingLayer
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 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]
S: Subscriber + for<'a> LookupSpan<'a>,
W: MakeWriter + 'static,
fn on_event(&self, event: &Event, ctx: Context<S>)
[src]
fn on_enter(&self, id: &Id, ctx: Context<S>)
[src]
fn on_exit(&self, id: &Id, ctx: Context<S>)
[src]
fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
[src]
fn enabled(&self, metadata: &Metadata, ctx: Context<S>) -> bool
[src]
fn new_span(&self, attrs: &Attributes, id: &Id, ctx: Context<S>)
[src]
fn on_record(&self, _span: &Id, _values: &Record, _ctx: Context<S>)
[src]
fn on_follows_from(&self, _span: &Id, _follows: &Id, _ctx: Context<S>)
[src]
fn on_close(&self, _id: Id, _ctx: Context<S>)
[src]
fn on_id_change(&self, _old: &Id, _new: &Id, _ctx: Context<S>)
[src]
fn and_then<L>(self, layer: L) -> Layered<L, Self, S> where
L: Layer<S>,
[src]
L: Layer<S>,
fn with_subscriber(self, inner: S) -> Layered<Self, S, S>
[src]
Auto Trait Implementations
impl<W> RefUnwindSafe for BunyanFormattingLayer<W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
impl<W> Send for BunyanFormattingLayer<W> where
W: Send,
W: Send,
impl<W> Sync for BunyanFormattingLayer<W> where
W: Sync,
W: Sync,
impl<W> Unpin for BunyanFormattingLayer<W> where
W: Unpin,
W: Unpin,
impl<W> UnwindSafe for BunyanFormattingLayer<W> where
W: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,