• Home
  • Raw
  • Download

Lines Matching full:subscriber

1 use tracing_core::{metadata::Metadata, span, subscriber::Subscriber, Event};
8 /// wrapped [`Subscriber`].
11 /// trait should ensure that the `Subscriber` type parameter is *also* bound by the
15 /// use tracing::Subscriber;
22 /// S: Subscriber + for<'a> LookupSpan<'a>,
29 /// [`Subscriber`]: tracing_core::Subscriber
34 subscriber: Option<&'a S>, field
53 S: Subscriber,
55 pub(super) fn new(subscriber: &'a S) -> Self { in new()
57 subscriber: Some(subscriber), in new()
64 /// Returns the wrapped subscriber's view of the current span.
67 self.subscriber in current_span()
68 .map(Subscriber::current_span) in current_span()
74 /// Returns whether the wrapped subscriber would enable the current span.
77 self.subscriber in enabled()
78 .map(|subscriber| subscriber.enabled(metadata)) in enabled()
81 // the inner subscriber has disabled this metadata. in enabled()
86 /// Records the provided `event` with the wrapped subscriber.
90 /// - The subscriber is free to expect that the event's callsite has been
96 /// - This does _not_ call [`enabled`] on the inner subscriber. If the
97 /// caller wishes to apply the wrapped subscriber's filter before choosing
102 /// [register]: tracing_core::subscriber::Subscriber::register_callsite()
103 /// [`enabled`]: tracing_core::subscriber::Subscriber::enabled()
107 if let Some(subscriber) = self.subscriber { in event()
108 subscriber.event(event); in event()
129 /// use tracing::{Event, Subscriber};
139 /// S: Subscriber + for<'lookup> LookupSpan<'lookup>,
147 /// tracing::subscriber::with_default(tracing_subscriber::registry().with(PrintingLayer), || {
162 /// <strong>Note</strong>: This requires the wrapped subscriber to
202 /// <strong>Note</strong>: This requires the wrapped subscriber to
215 let span = self.subscriber.as_ref()?.span(id)?; in span()
227 /// <strong>Note</strong>: This requires the wrapped subscriber to
238 self.subscriber.as_ref().and_then(|s| s.span(id)).is_some() in exists()
241 /// Returns [stored data] for the span that the wrapped subscriber considers
247 /// <strong>Note</strong>: This requires the wrapped subscriber to
260 let subscriber = *self.subscriber.as_ref()?; in lookup_current() localVariable
261 let current = subscriber.current_span(); in lookup_current()
263 let span = subscriber.span(id); in lookup_current()
266 "the subscriber should have data for the current span ({:?})!", in lookup_current()
282 // subscriber to a a `Registry`, we can iterate over its current span in lookup_current()
287 self.lookup_current_filtered(subscriber) in lookup_current()
299 // factored out to prevent the loop and (potentially-recursive) subscriber
305 subscriber: &'lookup S, in lookup_current_filtered()
310 let registry = (subscriber as &dyn Subscriber).downcast_ref::<Registry>()?; in lookup_current_filtered()
314 .find_map(|id| subscriber.span(id)?.try_with_filter(self.filter)) in lookup_current_filtered()
329 /// <strong>Note</strong>: This requires the wrapped subscriber to
356 /// <strong>Note</strong>: This requires the wrapped subscriber to
415 subscriber: None, in none()
426 let subscriber = self.subscriber.as_ref().copied(); in clone() localVariable
428 subscriber, in clone()