Struct tracing_sprout::TrunkLayer[][src]

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

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]

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]

Auto Trait Implementations

impl<W> RefUnwindSafe for TrunkLayer<W> where
    W: RefUnwindSafe
[src]

impl<W> Send for TrunkLayer<W> where
    W: Send
[src]

impl<W> Sync for TrunkLayer<W> where
    W: Sync
[src]

impl<W> Unpin for TrunkLayer<W> where
    W: Unpin
[src]

impl<W> UnwindSafe for TrunkLayer<W> where
    W: UnwindSafe
[src]

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> Instrument 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.