Struct tracing_sprout::TrunkLayer [−][src]
The subscriber layer, add this to your application's tracing regisitry to initialize it
Example
use tracing::{subscriber::set_global_default, Subscriber}; use tracing_sprout::TrunkLayer; use tracing_subscriber::prelude::*; use tracing_subscriber::{EnvFilter, Registry}; let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")); let formatting_layer = TrunkLayer::new("My Application".to_string(), std::io::stdout); let subscriber = Registry::default() .with(env_filter) .with(formatting_layer); set_global_default(subscriber).expect("failed to set up global tracing subscriber")
Implementations
impl<W> TrunkLayer<W> where
W: MakeWriter + 'static,
[src]
W: MakeWriter + 'static,
pub fn new(name: String, writer: W) -> Self
[src]
Construct a new TrunkLayer to add to the Tracing Registry
Examples
use tracing_sprout::TrunkLayer; let layer = TrunkLayer::new("I am Groot".to_string(), std::io::stdout);
Trait Implementations
impl<S, W> Layer<S> for TrunkLayer<W> where
S: Subscriber + for<'a> LookupSpan<'a>,
W: MakeWriter + 'static,
[src]
S: Subscriber + for<'a> LookupSpan<'a>,
W: MakeWriter + 'static,
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_enter(&self, span: &Id, ctx: Context<'_, S>)
[src]
fn on_event(&self, event: &Event<'_>, 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_follows_from(&self, _span: &Id, _follows: &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 TrunkLayer<W> where
W: RefUnwindSafe,
[src]
W: RefUnwindSafe,
impl<W> Send for TrunkLayer<W> where
W: Send,
[src]
W: Send,
impl<W> Sync for TrunkLayer<W> where
W: Sync,
[src]
W: Sync,
impl<W> Unpin for TrunkLayer<W> where
W: Unpin,
[src]
W: Unpin,
impl<W> UnwindSafe for TrunkLayer<W> where
W: UnwindSafe,
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[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.
pub 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>,