pub struct Logger { /* private fields */ }Expand description
Structured logger with trace context
Implementations§
Source§impl Logger
impl Logger
Sourcepub fn with_context(self, context: TracingContext) -> Self
pub fn with_context(self, context: TracingContext) -> Self
Set trace context
Sourcepub fn with_level(self, level: TraceLevel) -> Self
pub fn with_level(self, level: TraceLevel) -> Self
Set minimum log level
Sourcepub fn log(&mut self, level: TraceLevel, message: &str)
pub fn log(&mut self, level: TraceLevel, message: &str)
Log at specified level
Sourcepub fn context(&self) -> Option<&TracingContext>
pub fn context(&self) -> Option<&TracingContext>
Get context
Sourcepub fn context_mut(&mut self) -> Option<&mut TracingContext>
pub fn context_mut(&mut self) -> Option<&mut TracingContext>
Get mutable context
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Logger
impl RefUnwindSafe for Logger
impl Send for Logger
impl Sync for Logger
impl Unpin for Logger
impl UnwindSafe for Logger
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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