pub struct TracingBuilder {
pub(crate) disable_progress_bars: bool,
pub(crate) tracers: EnumSet<Tracer>,
pub(crate) level: ChosenLevel,
}Fields§
§disable_progress_bars: bool§tracers: EnumSet<Tracer>otlp or tracy or chrome only.level: ChosenLevelImplementations§
Source§impl TracingBuilder
impl TracingBuilder
Sourcepub fn enable_tracer(self, tracer: Tracer) -> TracingBuilder
Available on crate features otlp or tracy or chrome only.
pub fn enable_tracer(self, tracer: Tracer) -> TracingBuilder
otlp or tracy or chrome only.Enable the given tracer
Sourcepub fn enable_tracers<I>(self, tracers: I) -> TracingBuilderwhere
I: IntoIterator<Item = Tracer>,
Available on crate features otlp or tracy or chrome only.
pub fn enable_tracers<I>(self, tracers: I) -> TracingBuilderwhere
I: IntoIterator<Item = Tracer>,
otlp or tracy or chrome only.Enable the given tracers
Sourcepub fn disable_progress_bars(self) -> TracingBuilder
pub fn disable_progress_bars(self) -> TracingBuilder
Disable progress bars explicitly, even though they would still match the chosen log level.
Sourcepub fn build(self) -> Result<TracingHandle, Error>
pub fn build(self) -> Result<TracingHandle, Error>
This will setup tracing based on the configuration passed in. It will setup a stderr writer output layer and configure EnvFilter to honor RUST_LOG. The EnvFilter will be applied to all configured layers, also otlp.
It will also configure otlp if the feature is enabled and a service_name was provided. It will then correctly setup a channel which is later used for flushing the provider.
Sourcepub fn build_with_additional<L>(
self,
additional_layer: L,
) -> Result<TracingHandle, Error>
pub fn build_with_additional<L>( self, additional_layer: L, ) -> Result<TracingHandle, Error>
Similar to build() but allows passing in an additional tracing Layer.
This method is generic over the Layer to avoid the runtime cost of dynamic dispatch.
While it only allows passing a single Layer, it can be composed of multiple ones:
build_with_additional(
fmt::layer()
.and_then(some_other_layer)
.and_then(yet_another_layer)
.with_filter(my_filter)
)Sourcepub fn handle_verbosity_flags<L: LogLevel>(self, args: &Verbosity<L>) -> Self
Available on crate feature clap only.
pub fn handle_verbosity_flags<L: LogLevel>(self, args: &Verbosity<L>) -> Self
clap only.Configure with verbosity flags.
Sourcepub fn handle_tracing_args<L: LogLevel>(self, args: &TracingArgs<L>) -> Self
Available on crate feature clap only.
pub fn handle_tracing_args<L: LogLevel>(self, args: &TracingArgs<L>) -> Self
clap only.Configure with the tracing-related args.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TracingBuilder
impl RefUnwindSafe for TracingBuilder
impl Send for TracingBuilder
impl Sync for TracingBuilder
impl Unpin for TracingBuilder
impl UnwindSafe for TracingBuilder
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request