pub struct TemplateFormatter { /* private fields */ }
Expand description
A template formatter that formats log records using a template
Implementations§
Source§impl TemplateFormatter
impl TemplateFormatter
pub fn new(pattern: impl Into<String>) -> Self
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§
Source§impl Clone for TemplateFormatter
impl Clone for TemplateFormatter
Source§fn clone(&self) -> TemplateFormatter
fn clone(&self) -> TemplateFormatter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TemplateFormatter
impl Debug for TemplateFormatter
Source§impl Default for TemplateFormatter
impl Default for TemplateFormatter
Source§impl FormatterTrait for TemplateFormatter
impl FormatterTrait for TemplateFormatter
Source§fn with_colors(&mut self, use_colors: bool)
fn with_colors(&mut self, use_colors: bool)
Enable or disable colored output
Source§fn with_timestamp(&mut self, include_timestamp: bool)
fn with_timestamp(&mut self, include_timestamp: bool)
Enable or disable timestamp output
Source§fn with_level(&mut self, include_level: bool)
fn with_level(&mut self, include_level: bool)
Enable or disable level output
Source§fn with_module(&mut self, include_module: bool)
fn with_module(&mut self, include_module: bool)
Enable or disable module output
Source§fn with_location(&mut self, include_location: bool)
fn with_location(&mut self, include_location: bool)
Enable or disable location output
Source§fn with_pattern(&mut self, pattern: String)
fn with_pattern(&mut self, pattern: String)
Set the pattern for formatting
Source§fn with_format(&mut self, format_fn: FormatFn)
fn with_format(&mut self, format_fn: FormatFn)
Set a custom format function
Auto Trait Implementations§
impl Freeze for TemplateFormatter
impl !RefUnwindSafe for TemplateFormatter
impl Send for TemplateFormatter
impl Sync for TemplateFormatter
impl Unpin for TemplateFormatter
impl !UnwindSafe for TemplateFormatter
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