pub enum Formatter {
Text(TextFormatter),
Json(JsonFormatter),
Template(TemplateFormatter),
}Expand description
A formatter that can format log records
Variants§
Implementations§
Source§impl Formatter
impl Formatter
pub fn text() -> Self
pub fn json() -> Self
pub fn template() -> Self
pub fn format(&self, record: &Record) -> String
pub fn with_colors(self, use_colors: bool) -> Self
pub fn with_timestamp(self, include_timestamp: bool) -> Self
pub fn with_level(self, include_level: bool) -> Self
pub fn with_module(self, include_module: bool) -> Self
pub fn with_location(self, include_location: bool) -> Self
pub fn with_pattern(self, pattern: impl Into<String>) -> Self
pub fn with_format<F>(self, format_fn: F) -> Self
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