pub type Formatter<N = DefaultFields, E = Format<Full>, W = fn() -> Stdout> = Layered<Layer<Registry, N, E, W>, Registry>;
Expand description
A Subscriber
that logs formatted representations of tracing
events.
This type only logs formatted events; it does not perform any filtering.
Aliased Type§
struct Formatter<N = DefaultFields, E = Format<Full>, W = fn() -> Stdout> { /* private fields */ }
Implementations
Source§impl<L, S> Layered<L, S>where
L: Layer<S>,
S: Subscriber,
impl<L, S> Layered<L, S>where
L: Layer<S>,
S: Subscriber,
Sourcepub fn is<T: Any>(&self) -> bool
pub fn is<T: Any>(&self) -> bool
Returns true
if this Subscriber
is the same type as T
.
Sourcepub fn downcast_ref<T: Any>(&self) -> Option<&T>
pub fn downcast_ref<T: Any>(&self) -> Option<&T>
Returns some reference to this Subscriber
value if it is of type T
,
or None
if it isn’t.
Trait Implementations
Source§impl<S, A, B> Layer<S> for Layered<A, B, S>
impl<S, A, B> Layer<S> for Layered<A, B, S>
Source§fn on_register_dispatch(&self, subscriber: &Dispatch)
fn on_register_dispatch(&self, subscriber: &Dispatch)
Performs late initialization when installing this layer as a
Subscriber
. Read moreSource§fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
Registers a new callsite with this layer, returning whether or not
the layer is interested in being notified about the callsite, similarly
to
Subscriber::register_callsite
. Read moreSource§fn enabled(&self, metadata: &Metadata<'_>, ctx: Context<'_, S>) -> bool
fn enabled(&self, metadata: &Metadata<'_>, ctx: Context<'_, S>) -> bool
Returns
true
if this layer is interested in a span or event with the
given metadata
in the current Context
, similarly to
Subscriber::enabled
. Read moreSource§fn on_new_span(&self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, S>)
fn on_new_span(&self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, S>)
Notifies this layer that a new span was constructed with the given
Attributes
and Id
.Source§fn on_record(&self, span: &Id, values: &Record<'_>, ctx: Context<'_, S>)
fn on_record(&self, span: &Id, values: &Record<'_>, ctx: Context<'_, S>)
Notifies this layer that a span with the given
Id
recorded the given
values
.Source§fn on_follows_from(&self, span: &Id, follows: &Id, ctx: Context<'_, S>)
fn on_follows_from(&self, span: &Id, follows: &Id, ctx: Context<'_, S>)
Notifies this layer that a span with the ID
span
recorded that it
follows from the span with the ID follows
.Source§fn on_event(&self, event: &Event<'_>, ctx: Context<'_, S>)
fn on_event(&self, event: &Event<'_>, ctx: Context<'_, S>)
Notifies this layer that an event has occurred.
Source§fn on_enter(&self, id: &Id, ctx: Context<'_, S>)
fn on_enter(&self, id: &Id, ctx: Context<'_, S>)
Notifies this layer that a span with the given ID was entered.
Source§fn on_exit(&self, id: &Id, ctx: Context<'_, S>)
fn on_exit(&self, id: &Id, ctx: Context<'_, S>)
Notifies this layer that the span with the given ID was exited.
Source§fn on_close(&self, id: Id, ctx: Context<'_, S>)
fn on_close(&self, id: Id, ctx: Context<'_, S>)
Notifies this layer that the span with the given ID has been closed.
Source§fn on_id_change(&self, old: &Id, new: &Id, ctx: Context<'_, S>)
fn on_id_change(&self, old: &Id, new: &Id, ctx: Context<'_, S>)
Notifies this layer that a span ID has been cloned, and that the
subscriber returned a different ID.
Source§fn and_then<L>(self, layer: L) -> Layered<L, Self, S>
fn and_then<L>(self, layer: L) -> Layered<L, Self, S>
Composes this layer around the given
Layer
, returning a Layered
struct implementing Layer
. Read moreSource§fn with_subscriber(self, inner: S) -> Layered<Self, S>where
Self: Sized,
fn with_subscriber(self, inner: S) -> Layered<Self, S>where
Self: Sized,
Composes this
Layer
with the given Subscriber
, returning a
Layered
struct that implements Subscriber
. Read moreSource§fn with_filter<F>(self, filter: F) -> Filtered<Self, F, S>
fn with_filter<F>(self, filter: F) -> Filtered<Self, F, S>
Source§impl<'a, L, S> LookupSpan<'a> for Layered<L, S>where
S: Subscriber + LookupSpan<'a>,
impl<'a, L, S> LookupSpan<'a> for Layered<L, S>where
S: Subscriber + LookupSpan<'a>,
Source§impl<L, S> Subscriber for Layered<L, S>where
L: Layer<S>,
S: Subscriber,
impl<L, S> Subscriber for Layered<L, S>where
L: Layer<S>,
S: Subscriber,
Source§fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
Source§fn max_level_hint(&self) -> Option<LevelFilter>
fn max_level_hint(&self) -> Option<LevelFilter>
Returns the highest verbosity level that this
Subscriber
will
enable, or None
, if the subscriber does not implement level-based
filtering or chooses not to implement this method. Read moreSource§fn new_span(&self, span: &Attributes<'_>) -> Id
fn new_span(&self, span: &Attributes<'_>) -> Id
Source§fn record_follows_from(&self, span: &Id, follows: &Id)
fn record_follows_from(&self, span: &Id, follows: &Id)
Source§fn event_enabled(&self, event: &Event<'_>) -> bool
fn event_enabled(&self, event: &Event<'_>) -> bool
Source§fn clone_span(&self, old: &Id) -> Id
fn clone_span(&self, old: &Id) -> Id
Source§fn drop_span(&self, id: Id)
fn drop_span(&self, id: Id)
👎Deprecated since 0.1.2: use
Subscriber::try_close
insteadThis method is deprecated. Read more
Source§fn current_span(&self) -> Current
fn current_span(&self) -> Current
Returns a type representing this subscriber’s view of the current span. Read more