pub struct EventMetadata {
pub level: String,
pub message: String,
pub target: String,
pub fields: BTreeMap<Cow<'static, str>, Cow<'static, str>>,
}Expand description
Metadata about a log event for human-readable summaries.
Stores the essential details needed to understand what event was suppressed without having to correlate the signature hash with the original log.
Uses Cow<'static, str> to reduce allocations when possible, particularly
for field names which are often static in tracing macros.
Fields§
§level: StringLog level (e.g., “INFO”, “WARN”, “ERROR”)
message: StringMessage template
target: StringTarget module path
fields: BTreeMap<Cow<'static, str>, Cow<'static, str>>Structured fields (key-value pairs)
Implementations§
Source§impl EventMetadata
impl EventMetadata
Sourcepub fn new(
level: String,
message: String,
target: String,
fields: BTreeMap<Cow<'static, str>, Cow<'static, str>>,
) -> Self
pub fn new( level: String, message: String, target: String, fields: BTreeMap<Cow<'static, str>, Cow<'static, str>>, ) -> Self
Create new event metadata.
Sourcepub fn format_brief(&self) -> String
pub fn format_brief(&self) -> String
Format a brief description of the event for display.
Returns a string like: [ERROR] database::connection: Connection failed
Sourcepub fn format_detailed(&self) -> String
pub fn format_detailed(&self) -> String
Format the event with fields for detailed display.
Returns a string like: [ERROR] database::connection: Connection failed {error_code="TIMEOUT", retry_count="3"}
Trait Implementations§
Source§impl Clone for EventMetadata
impl Clone for EventMetadata
Source§fn clone(&self) -> EventMetadata
fn clone(&self) -> EventMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EventMetadata
impl Debug for EventMetadata
Source§impl PartialEq for EventMetadata
impl PartialEq for EventMetadata
impl Eq for EventMetadata
impl StructuralPartialEq for EventMetadata
Auto Trait Implementations§
impl Freeze for EventMetadata
impl RefUnwindSafe for EventMetadata
impl Send for EventMetadata
impl Sync for EventMetadata
impl Unpin for EventMetadata
impl UnwindSafe for EventMetadata
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