pub struct JsonFormatter { /* private fields */ }
Expand description
A JSON formatter that formats log records as JSON
Implementations§
Source§impl JsonFormatter
impl JsonFormatter
pub fn new() -> 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_format<F>(self, format_fn: F) -> Self
Trait Implementations§
Source§impl Clone for JsonFormatter
impl Clone for JsonFormatter
Source§fn clone(&self) -> JsonFormatter
fn clone(&self) -> JsonFormatter
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 JsonFormatter
impl Debug for JsonFormatter
Source§impl Default for JsonFormatter
impl Default for JsonFormatter
Source§impl FormatterTrait for JsonFormatter
impl FormatterTrait for JsonFormatter
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 JsonFormatter
impl !RefUnwindSafe for JsonFormatter
impl Send for JsonFormatter
impl Sync for JsonFormatter
impl Unpin for JsonFormatter
impl !UnwindSafe for JsonFormatter
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