pub struct LoggingRuntime { /* private fields */ }Expand description
Owns logging resources that must remain alive for the process / run lifetime.
When created by LoggingRuntime::configure, dropping this value flushes sinks and detaches this
logger from the process-global spdlog log proxy if it is still installed.
Implementations§
Source§impl LoggingRuntime
impl LoggingRuntime
Sourcepub fn configure(config: LoggingConfig) -> Result<Self>
pub fn configure(config: LoggingConfig) -> Result<Self>
Installs process-wide operational logging from resolved configuration.
Stderr is always enabled. Explicit file sinks fail initialization if they cannot be
opened. Dropping the returned runtime flushes sinks and detaches its logger from the
process-global log proxy when it is still installed.
Sourcepub fn configure_from_file_path(path: impl AsRef<Path>) -> Result<Self>
pub fn configure_from_file_path(path: impl AsRef<Path>) -> Result<Self>
Loads logging configuration from an absolute TOML path and installs it process-wide.
Sourcepub fn configure_from_environment() -> Result<Self>
pub fn configure_from_environment() -> Result<Self>
Resolves supported logging environment variables and installs the resulting configuration.
Built-in defaults are used when no logging environment variables are present.
Sourcepub fn root_relay_id(&self) -> &str
pub fn root_relay_id(&self) -> &str
Returns the process root Relay ID attached to operational records after initialization.
Trait Implementations§
Source§impl Drop for LoggingRuntime
impl Drop for LoggingRuntime
Auto Trait Implementations§
impl !RefUnwindSafe for LoggingRuntime
impl !UnwindSafe for LoggingRuntime
impl Freeze for LoggingRuntime
impl Send for LoggingRuntime
impl Sync for LoggingRuntime
impl Unpin for LoggingRuntime
impl UnsafeUnpin for LoggingRuntime
Blanket Implementations§
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> 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> 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 moreSource§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