pub struct EventLogger { /* private fields */ }Expand description
Logger that writes events to a JSONL file.
Implementations§
Source§impl EventLogger
impl EventLogger
Sourcepub const DEFAULT_PATH: &'static str = ".ralph/events.jsonl"
pub const DEFAULT_PATH: &'static str = ".ralph/events.jsonl"
Default path for the events file.
Sourcepub fn new(path: impl Into<PathBuf>) -> Self
pub fn new(path: impl Into<PathBuf>) -> Self
Creates a new event logger.
The .ralph/ directory is created if it doesn’t exist.
Sourcepub fn default_path() -> Self
pub fn default_path() -> Self
Creates a logger with the default path.
Sourcepub fn log(&mut self, record: &EventRecord) -> Result<()>
pub fn log(&mut self, record: &EventRecord) -> Result<()>
Logs an event record.
Auto Trait Implementations§
impl Freeze for EventLogger
impl RefUnwindSafe for EventLogger
impl Send for EventLogger
impl Sync for EventLogger
impl Unpin for EventLogger
impl UnsafeUnpin for EventLogger
impl UnwindSafe for EventLogger
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