pub struct LogEvent {
pub timestamp: SystemTime,
pub severity: Severity,
pub message: String,
pub labels: Labels,
pub fields: BTreeMap<String, String>,
}Expand description
A structured log entry with a timestamp, severity, message, labels, and arbitrary fields.
Labels are scenario-level key-value pairs (injected by the log runner). Fields are event-level key-value metadata (produced by the generator). Both are stored in sorted containers for deterministic serialization.
Fields§
§timestamp: SystemTimeThe time at which the event was generated.
severity: SeverityThe severity level of the event.
message: StringThe human-readable log message.
labels: LabelsScenario-level static labels attached to every event in this scenario.
fields: BTreeMap<String, String>Arbitrary key-value metadata attached to the event.
Implementations§
Source§impl LogEvent
impl LogEvent
Sourcepub fn new(
severity: Severity,
message: String,
labels: Labels,
fields: BTreeMap<String, String>,
) -> Self
pub fn new( severity: Severity, message: String, labels: Labels, fields: BTreeMap<String, String>, ) -> Self
Sourcepub fn with_timestamp(
timestamp: SystemTime,
severity: Severity,
message: String,
labels: Labels,
fields: BTreeMap<String, String>,
) -> Self
pub fn with_timestamp( timestamp: SystemTime, severity: Severity, message: String, labels: Labels, fields: BTreeMap<String, String>, ) -> Self
Create a LogEvent with an explicit timestamp.
Useful for deterministic testing and log replay scenarios where the original timestamp must be preserved.
§Arguments
timestamp— The exact timestamp to record.severity— The severity level.message— The human-readable message.labels— Scenario-level static labels.fields— Arbitrary key-value metadata.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogEvent
impl RefUnwindSafe for LogEvent
impl Send for LogEvent
impl Sync for LogEvent
impl Unpin for LogEvent
impl UnsafeUnpin for LogEvent
impl UnwindSafe for LogEvent
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