[][src]Struct tracing_subscriber::fmt::format::Json

pub struct Json { /* fields omitted */ }
This is supported on crate feature fmt only.

Marker for Format that indicates that the verbose json log format should be used.

The full format includes fields from all entered spans.

Example Output

This example is not tested
{
    "timestamp":"Feb 20 11:28:15.096",
    "level":"INFO",
    "fields":{"message":"some message","key":"value"}
    "target":"mycrate",
    "span":{name":"leaf"},
    "spans":[{"name":"root"},{"name":"leaf"}],
}

Options

By default, event fields are not flattened, and both current span and span list are logged.

Implementations

impl Json[src]

pub fn flatten_event(&mut self, flatten_event: bool)[src]

This is supported on crate feature fmt only.

If set to true event metadata will be flattened into the root object.

pub fn with_current_span(&mut self, display_current_span: bool)[src]

This is supported on crate feature fmt only.

If set to false, formatted events won't contain a field for the current span.

pub fn with_span_list(&mut self, display_span_list: bool)[src]

This is supported on crate feature fmt only.

If set to false, formatted events won't contain a list of all currently entered spans. Spans are logged in a list from root to leaf.

Trait Implementations

impl Clone for Json[src]

impl Copy for Json[src]

impl Debug for Json[src]

impl Default for Json[src]

impl Eq for Json[src]

impl PartialEq<Json> for Json[src]

impl StructuralEq for Json[src]

impl StructuralPartialEq for Json[src]

Auto Trait Implementations

impl RefUnwindSafe for Json

impl Send for Json

impl Sync for Json

impl Unpin for Json

impl UnwindSafe for Json

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.