Struct tracing_subscriber::fmt::format::Json [−][src]
pub struct Json { /* fields omitted */ }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_eventcan be used to enable flattening event fields into the rootJson::with_current_spancan be used to control logging of the current spanJson::with_span_listcan 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]
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 Copy for Json[src]
impl Eq 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> Instrument for T[src]
impl<T> Instrument for T[src]