pub struct SolinkJsonFormat { /* private fields */ }Expand description
FormatEvent for serializing data as JSON.
Adapted from the example in https://github.com/tokio-rs/tracing/issues/2670.
Implementations§
Source§impl SolinkJsonFormat
impl SolinkJsonFormat
pub fn new() -> Self
Sourcepub fn with_timestamp(self, add_timestamp: bool) -> Self
pub fn with_timestamp(self, add_timestamp: bool) -> Self
Set whether to add a timestamp to the log.
Sourcepub fn with_target(self, add_target: bool) -> Self
pub fn with_target(self, add_target: bool) -> Self
Set whether to add the target to the log.
Trait Implementations§
Source§impl Default for SolinkJsonFormat
impl Default for SolinkJsonFormat
Source§impl<S, N> FormatEvent<S, N> for SolinkJsonFormatwhere
S: Subscriber + for<'lookup> LookupSpan<'lookup>,
N: for<'writer> FormatFields<'writer> + 'static,
impl<S, N> FormatEvent<S, N> for SolinkJsonFormatwhere
S: Subscriber + for<'lookup> LookupSpan<'lookup>,
N: for<'writer> FormatFields<'writer> + 'static,
Source§fn format_event(
&self,
ctx: &FmtContext<'_, S, N>,
writer: Writer<'_>,
event: &Event<'_>,
) -> Resultwhere
S: Subscriber + for<'a> LookupSpan<'a>,
fn format_event(
&self,
ctx: &FmtContext<'_, S, N>,
writer: Writer<'_>,
event: &Event<'_>,
) -> Resultwhere
S: Subscriber + for<'a> LookupSpan<'a>,
Auto Trait Implementations§
impl Freeze for SolinkJsonFormat
impl RefUnwindSafe for SolinkJsonFormat
impl Send for SolinkJsonFormat
impl Sync for SolinkJsonFormat
impl Unpin for SolinkJsonFormat
impl UnwindSafe for SolinkJsonFormat
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