pub struct AtemporalMessageFormatter {}Expand description
A high-performance, stateful formatter that produces undated logs.
§Output Format
The formatter produces a single line per message using the following pattern:
[ [Level] ] [Message]
- Level: The log level is uppercase, padded with single spaces inside brackets
(e.g.,
[ DEBUG ],[ INFO ],[ ERROR ]). - Message: The raw message content followed by a newline (
\n).
§Example Output
[ INFO ] Service started successfully
[ DEBUG ] Connecting to Loki at localhost:3100Implementations§
Trait Implementations§
Source§impl Default for AtemporalMessageFormatter
impl Default for AtemporalMessageFormatter
Source§fn default() -> AtemporalMessageFormatter
fn default() -> AtemporalMessageFormatter
Returns the “default value” for a type. Read more
Source§impl MessageFormatter for AtemporalMessageFormatter
impl MessageFormatter for AtemporalMessageFormatter
Source§fn format_io(
&mut self,
message: &Message,
write: &mut (dyn Write + Send + Sync),
) -> Result<(), ServiceError>
fn format_io( &mut self, message: &Message, write: &mut (dyn Write + Send + Sync), ) -> Result<(), ServiceError>
Formats and writes the message to the provided I/O sink. Read more
Source§fn format_fmt(
&mut self,
message: &Message,
write: &mut (dyn Write + Send + Sync),
) -> Result<(), ServiceError>
fn format_fmt( &mut self, message: &Message, write: &mut (dyn Write + Send + Sync), ) -> Result<(), ServiceError>
Formats a message specifically for fmt-based destinations.
Auto Trait Implementations§
impl Freeze for AtemporalMessageFormatter
impl RefUnwindSafe for AtemporalMessageFormatter
impl Send for AtemporalMessageFormatter
impl Sync for AtemporalMessageFormatter
impl Unpin for AtemporalMessageFormatter
impl UnwindSafe for AtemporalMessageFormatter
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.