pub struct LogEntry {
pub runlevel: String,
pub message: String,
pub arrived_at: f64,
}Expand description
A buffered log entry from Tor.
Contains the log level, message content, and arrival timestamp. Entries are stored in a ring buffer and dumped when circuits are closed.
§Fields
runlevel- The log level (DEBUG, INFO, NOTICE, WARN, ERR)message- The log message contentarrived_at- Unix timestamp when the log entry arrived
§Example
use vanguards_rs::logguard::LogEntry;
// Create entry with current timestamp
let entry = LogEntry::new("NOTICE", "Circuit 123 built");
assert_eq!(entry.runlevel, "NOTICE");
assert_eq!(entry.message, "Circuit 123 built");
// Create entry with specific timestamp
let entry = LogEntry::with_timestamp("WARN", "Connection lost", 1234567890.5);
println!("{}", entry.format());§See Also
LogGuard- Container for log entries
Fields§
§runlevel: StringThe log level (DEBUG, INFO, NOTICE, WARN, ERR).
message: StringThe log message content.
arrived_at: f64Unix timestamp when the log entry arrived.
Implementations§
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