pub struct Formatter {
pub use_colors: bool,
pub include_timestamp: bool,
pub include_level: bool,
pub include_module: bool,
pub include_location: bool,
pub pattern: String,
/* private fields */
}
Expand description
A formatter for log records
Fields§
§use_colors: bool
Whether to use colors in the output
include_timestamp: bool
Whether to include timestamps
include_level: bool
Whether to include the log level
include_module: bool
Whether to include the module path
include_location: bool
Whether to include the file and line number
pattern: String
The format pattern to use
Implementations§
Source§impl Formatter
impl Formatter
Sourcepub fn with_colors(self, use_colors: bool) -> Self
pub fn with_colors(self, use_colors: bool) -> Self
Set whether to use colors
Sourcepub fn with_timestamp(self, include_timestamp: bool) -> Self
pub fn with_timestamp(self, include_timestamp: bool) -> Self
Set whether to include timestamps
Sourcepub fn with_level(self, include_level: bool) -> Self
pub fn with_level(self, include_level: bool) -> Self
Set whether to include the log level
Sourcepub fn with_module(self, include_module: bool) -> Self
pub fn with_module(self, include_module: bool) -> Self
Set whether to include the module path
Sourcepub fn with_location(self, include_location: bool) -> Self
pub fn with_location(self, include_location: bool) -> Self
Set whether to include the file and line number
Sourcepub fn with_pattern(self, pattern: impl Into<String>) -> Self
pub fn with_pattern(self, pattern: impl Into<String>) -> Self
Sets the format pattern to use.
Sourcepub fn with_format<F>(self, format_fn: F) -> Self
pub fn with_format<F>(self, format_fn: F) -> Self
Set a custom format function
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Formatter
impl !RefUnwindSafe for Formatter
impl Send for Formatter
impl Sync for Formatter
impl Unpin for Formatter
impl !UnwindSafe for Formatter
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