Struct SdkLoggerProvider
pub struct SdkLoggerProvider { /* private fields */ }
Expand description
Handles the creation and coordination of Logger
s.
All Logger
s created by a SdkLoggerProvider
will share the same
Resource
and have their created log records processed by the
configured log processors. This is a clonable handle to the SdkLoggerProvider
itself, and cloning it will create a new reference, not a new instance of a
SdkLoggerProvider
. Dropping the last reference will trigger the shutdown of
the provider, ensuring that all remaining logs are flushed and no further
logs are processed. Shutdown can also be triggered manually by calling
the shutdown
method.
Implementations§
§impl SdkLoggerProvider
impl SdkLoggerProvider
pub fn builder() -> LoggerProviderBuilder
pub fn builder() -> LoggerProviderBuilder
Create a new LoggerProvider
builder.
pub fn force_flush(&self) -> Result<(), OTelSdkError>
pub fn force_flush(&self) -> Result<(), OTelSdkError>
Force flush all remaining logs in log processors and return results.
pub fn shutdown_with_timeout(
&self,
timeout: Duration,
) -> Result<(), OTelSdkError>
pub fn shutdown_with_timeout( &self, timeout: Duration, ) -> Result<(), OTelSdkError>
Shuts down this LoggerProvider
pub fn shutdown(&self) -> Result<(), OTelSdkError>
pub fn shutdown(&self) -> Result<(), OTelSdkError>
Shuts down this LoggerProvider
with default timeout
Trait Implementations§
§impl Clone for SdkLoggerProvider
impl Clone for SdkLoggerProvider
§fn clone(&self) -> SdkLoggerProvider
fn clone(&self) -> SdkLoggerProvider
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for SdkLoggerProvider
impl Debug for SdkLoggerProvider
§impl LoggerProvider for SdkLoggerProvider
impl LoggerProvider for SdkLoggerProvider
§fn logger(
&self,
name: impl Into<Cow<'static, str>>,
) -> <SdkLoggerProvider as LoggerProvider>::Logger
fn logger( &self, name: impl Into<Cow<'static, str>>, ) -> <SdkLoggerProvider as LoggerProvider>::Logger
§fn logger_with_scope(
&self,
scope: InstrumentationScope,
) -> <SdkLoggerProvider as LoggerProvider>::Logger
fn logger_with_scope( &self, scope: InstrumentationScope, ) -> <SdkLoggerProvider as LoggerProvider>::Logger
Auto Trait Implementations§
impl Freeze for SdkLoggerProvider
impl !RefUnwindSafe for SdkLoggerProvider
impl Send for SdkLoggerProvider
impl Sync for SdkLoggerProvider
impl Unpin for SdkLoggerProvider
impl !UnwindSafe for SdkLoggerProvider
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more