pub struct Cerr<F>where
F: MessageFormatter,{ /* private fields */ }Expand description
A logging Service that targets the standard error stream (std::io::stderr).
Cerr service is typically used for high-priority alerts or diagnostic
information that should remain visible even if stdout is redirected to a file.
Implementations§
Trait Implementations§
Source§impl<F> Fallback for Cerr<F>where
F: MessageFormatter + 'static,
impl<F> Fallback for Cerr<F>where
F: MessageFormatter + 'static,
Source§fn fallback(&self, error: &ServiceError, msg: &Message)
fn fallback(&self, error: &ServiceError, msg: &Message)
Fallback for stderr failures. Paradoxically attempts to log the
failure to stdout as a last-resort communication channel.
Source§impl<F> Service for Cerr<F>where
F: MessageFormatter + 'static,
impl<F> Service for Cerr<F>where
F: MessageFormatter + 'static,
Source§fn work(&self, msg: &Message) -> Result<(), ServiceError>
fn work(&self, msg: &Message) -> Result<(), ServiceError>
Acquires the formatter lock and writes to the global stderr.
§Errors
Returns ServiceError::LockPoisoned if the internal formatter mutex is poisoned.
Source§fn status(&self) -> LoggerStatus
fn status(&self) -> LoggerStatus
Returns the current operational
[LoggerStatus] of the service.Auto Trait Implementations§
impl<F> !Freeze for Cerr<F>
impl<F> RefUnwindSafe for Cerr<F>
impl<F> Send for Cerr<F>
impl<F> Sync for Cerr<F>
impl<F> Unpin for Cerr<F>where
F: Unpin,
impl<F> UnwindSafe for Cerr<F>
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
§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>
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 moreCreates a shared type from an unshared type.