Struct tracing_bunyan_formatter::JsonStorage
source · pub struct JsonStorage<'a> { /* private fields */ }
Expand description
JsonStorage
will collect information about a span when it’s created (new_span
handler)
or when new records are attached to it (on_record
handler) and store it in its extensions
for future retrieval from other layers interested in formatting or further enrichment.
We are re-implementing (well, copy-pasting, apart from using an HashMap instead of a BTreeMap)
JsonVisitor
from tracing-subscriber
given that we can’t access/insert/iterate over
the underlying BTreeMap using its public API.
For spans, we also store the duration of each span with the elapsed_milliseconds
key using
the on_exit
/on_enter
handlers.
Implementations§
Trait Implementations§
source§impl<'a> Clone for JsonStorage<'a>
impl<'a> Clone for JsonStorage<'a>
source§fn clone(&self) -> JsonStorage<'a>
fn clone(&self) -> JsonStorage<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for JsonStorage<'a>
impl<'a> Debug for JsonStorage<'a>
source§impl Default for JsonStorage<'_>
impl Default for JsonStorage<'_>
Get a new visitor, with an empty bag of key-value pairs.
source§impl Visit for JsonStorage<'_>
impl Visit for JsonStorage<'_>
Taken verbatim from tracing-subscriber
source§fn record_i64(&mut self, field: &Field, value: i64)
fn record_i64(&mut self, field: &Field, value: i64)
Visit a signed 64-bit integer value.
source§fn record_u64(&mut self, field: &Field, value: u64)
fn record_u64(&mut self, field: &Field, value: u64)
Visit an unsigned 64-bit integer value.
source§fn record_f64(&mut self, field: &Field, value: f64)
fn record_f64(&mut self, field: &Field, value: f64)
Visit a 64-bit floating point value.
source§fn record_bool(&mut self, field: &Field, value: bool)
fn record_bool(&mut self, field: &Field, value: bool)
Visit a boolean value.
source§fn record_str(&mut self, field: &Field, value: &str)
fn record_str(&mut self, field: &Field, value: &str)
Visit a string value.
source§fn record_debug(&mut self, field: &Field, value: &dyn Debug)
fn record_debug(&mut self, field: &Field, value: &dyn Debug)
fmt::Debug
.source§fn record_i128(&mut self, field: &Field, value: i128)
fn record_i128(&mut self, field: &Field, value: i128)
source§fn record_u128(&mut self, field: &Field, value: u128)
fn record_u128(&mut self, field: &Field, value: u128)
source§fn record_error(&mut self, field: &Field, value: &(dyn Error + 'static))
fn record_error(&mut self, field: &Field, value: &(dyn Error + 'static))
Error
.