pub struct LogEntry {
pub timestamp: SystemTime,
pub level: LogLevel,
pub component: String,
pub operation_id: Option<u64>,
pub fd: Option<i32>,
pub message: String,
pub metadata: HashMap<String, String>,
pub duration: Option<Duration>,
}Expand description
Log entry containing structured information about safer-ring operations.
Fields§
§timestamp: SystemTimeTimestamp when the log entry was created
level: LogLevelLog level
component: StringComponent that generated the log
operation_id: Option<u64>Operation ID if applicable
fd: Option<i32>File descriptor if applicable
message: StringMessage content
metadata: HashMap<String, String>Additional structured data
duration: Option<Duration>Duration if this is a timing log
Implementations§
Source§impl LogEntry
impl LogEntry
Sourcepub fn with_operation_id(self, operation_id: u64) -> Self
pub fn with_operation_id(self, operation_id: u64) -> Self
Add operation ID to the log entry.
Sourcepub fn with_metadata(self, key: &str, value: &str) -> Self
pub fn with_metadata(self, key: &str, value: &str) -> Self
Add metadata to the log entry.
Sourcepub fn with_duration(self, duration: Duration) -> Self
pub fn with_duration(self, duration: Duration) -> Self
Add duration to the log entry.
Sourcepub fn format_json(&self) -> String
pub fn format_json(&self) -> String
Format the log entry as JSON.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogEntry
impl RefUnwindSafe for LogEntry
impl Send for LogEntry
impl Sync for LogEntry
impl Unpin for LogEntry
impl UnwindSafe for LogEntry
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