pub struct JsonLayout { /* private fields */ }
Expand description
A JSON layout for formatting log records.
Output format:
{"timestamp":"2024-08-11T22:44:57.172051+08:00","level":"ERROR","module_path":"file","file":"examples/file.rs","line":51,"message":"Hello error!"}
{"timestamp":"2024-08-11T22:44:57.172187+08:00","level":"WARN","module_path":"file","file":"examples/file.rs","line":52,"message":"Hello warn!"}
{"timestamp":"2024-08-11T22:44:57.172246+08:00","level":"INFO","module_path":"file","file":"examples/file.rs","line":53,"message":"Hello info!"}
{"timestamp":"2024-08-11T22:44:57.172300+08:00","level":"DEBUG","module_path":"file","file":"examples/file.rs","line":54,"message":"Hello debug!"}
{"timestamp":"2024-08-11T22:44:57.172353+08:00","level":"TRACE","module_path":"file","file":"examples/file.rs","line":55,"message":"Hello trace!"}
§Examples
use logforth_layout_json::JsonLayout;
let json_layout = JsonLayout::default();
Implementations§
Trait Implementations§
Source§impl Clone for JsonLayout
impl Clone for JsonLayout
Source§fn clone(&self) -> JsonLayout
fn clone(&self) -> JsonLayout
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 JsonLayout
impl Debug for JsonLayout
Source§impl Default for JsonLayout
impl Default for JsonLayout
Source§fn default() -> JsonLayout
fn default() -> JsonLayout
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for JsonLayout
impl RefUnwindSafe for JsonLayout
impl Send for JsonLayout
impl Sync for JsonLayout
impl Unpin for JsonLayout
impl UnwindSafe for JsonLayout
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