Struct tracing_subscriber::fmt::format::Json [−][src]
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
ⓘ
{ "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
Json::flatten_event
can be used to enable flattening event fields into the rootJson::with_current_span
can be used to control logging of the current spanJson::with_span_list
can be used to control logging of the span list object.
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]
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]
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]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,