pub struct Format<F = Full, T = SystemTime> {
format: F,
pub timer: T,
pub ansi: bool,
pub display_target: bool,
pub display_level: bool,
pub display_thread_id: bool,
pub display_thread_name: bool,
}Fields§
§format: F§timer: T§ansi: bool§display_target: bool§display_level: bool§display_thread_id: bool§display_thread_name: boolImplementations§
Source§impl<F, T> Format<F, T>
impl<F, T> Format<F, T>
Sourcepub fn with_timer<T2>(self, timer: T2) -> Format<F, T2>
pub fn with_timer<T2>(self, timer: T2) -> Format<F, T2>
Use the given timer for log message timestamps.
See time for the provided timer implementations.
Note that using the chrono feature flag enables the
additional time formatters ChronoUtc and ChronoLocal.
Sourcepub fn without_time(self) -> Format<F, ()>
pub fn without_time(self) -> Format<F, ()>
Do not emit timestamps with log messages.
Sourcepub fn with_ansi(self, ansi: bool) -> Format<F, T>
pub fn with_ansi(self, ansi: bool) -> Format<F, T>
Enable ANSI terminal colors for formatted output.
Sourcepub fn with_target(self, display_target: bool) -> Format<F, T>
pub fn with_target(self, display_target: bool) -> Format<F, T>
Sets whether or not an event’s target is displayed.
Sourcepub fn with_level(self, display_level: bool) -> Format<F, T>
pub fn with_level(self, display_level: bool) -> Format<F, T>
Sets whether or not an event’s level is displayed.
Sourcepub fn with_thread_ids(self, display_thread_id: bool) -> Format<F, T>
pub fn with_thread_ids(self, display_thread_id: bool) -> Format<F, T>
Sets whether or not the thread ID of the current thread is displayed when formatting events
Sourcepub fn with_thread_names(self, display_thread_name: bool) -> Format<F, T>
pub fn with_thread_names(self, display_thread_name: bool) -> Format<F, T>
Sets whether or not the name of the current thread is displayed when formatting events
Trait Implementations§
Source§impl<S, N, T> FormatEvent<S, N> for Format<Full, T>where
S: Subscriber + for<'a> LookupSpan<'a>,
N: for<'a> FormatFields<'a> + 'static,
T: FormatTime,
impl<S, N, T> FormatEvent<S, N> for Format<Full, T>where
S: Subscriber + for<'a> LookupSpan<'a>,
N: for<'a> FormatFields<'a> + 'static,
T: FormatTime,
Source§fn format_event(
&self,
context: &FmtContext<'_, S, N>,
writer: Writer<'_>,
event: &Event<'_>,
) -> Result
fn format_event( &self, context: &FmtContext<'_, S, N>, writer: Writer<'_>, event: &Event<'_>, ) -> Result
Write a log message for
Event in Context to the given [Writer].Auto Trait Implementations§
impl<F, T> Freeze for Format<F, T>
impl<F, T> RefUnwindSafe for Format<F, T>where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<F, T> Send for Format<F, T>
impl<F, T> Sync for Format<F, T>
impl<F, T> Unpin for Format<F, T>
impl<F, T> UnwindSafe for Format<F, T>where
F: UnwindSafe,
T: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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 more