pub struct Subscriber {
pub format: Option<Format>,
pub writer: Option<Writer>,
pub filter: Option<Filter>,
}
Expand description
Configuration for a totally dynamic subscriber.
Fields§
§format: Option<Format>
§writer: Option<Writer>
§filter: Option<Filter>
Implementations§
Source§impl Subscriber
impl Subscriber
Sourcepub fn layer<S>(self) -> (Layer<S>, Guard)where
S: Subscriber + for<'s> LookupSpan<'s>,
pub fn layer<S>(self) -> (Layer<S>, Guard)where
S: Subscriber + for<'s> LookupSpan<'s>,
Create a new Layer
, and a Guard
that handles e.g flushing NonBlocking
IO.
Errors when opening files or directories are deferred for the subscriber to handle (typically by logging).
If you wish to handle them yourself, see Self::try_layer
.
Note that filtering is ignored for layers.
Sourcepub fn try_layer<S>(self) -> Result<(Layer<S>, Guard), Error>where
S: Subscriber + for<'s> LookupSpan<'s>,
pub fn try_layer<S>(self) -> Result<(Layer<S>, Guard), Error>where
S: Subscriber + for<'s> LookupSpan<'s>,
Create a new Layer
, and a Guard
that handles e.g flushing NonBlocking
IO.
Returns Err
if e.g opening a log file fails.
If you wish the subscriber to handle them (typically by logging), see Self::layer
.
Note that filtering is ignored for layers.
Sourcepub fn builder(self) -> (SubscriberBuilder, Guard)
pub fn builder(self) -> (SubscriberBuilder, Guard)
Create a new SubscriberBuilder
, and a Guard
that handles e.g flushing NonBlocking
IO.
Errors when opening files or directories are deferred for the subscriber to handle (typically by logging).
If you wish to handle them yourself, see Self::try_builder
.
Sourcepub fn try_builder(self) -> Result<(SubscriberBuilder, Guard), Error>
pub fn try_builder(self) -> Result<(SubscriberBuilder, Guard), Error>
Create a new SubscriberBuilder
, and a Guard
that handles e.g flushing NonBlocking
IO.
Returns Err
if e.g opening a log file fails.
If you wish the subscriber to handle them (typically by logging), see Self::builder
.
Trait Implementations§
Source§impl Clone for Subscriber
impl Clone for Subscriber
Source§fn clone(&self) -> Subscriber
fn clone(&self) -> Subscriber
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more