pub struct Logger {
tx: UnboundedSender<LoggedEvent>,
write_lock: Arc<Mutex<()>>,
}Expand description
Background writer for events.jsonl. log is fire-and-forget over an
mpsc channel; the writer thread holds write_lock while appending so
clear_log can take the same lock to safely truncate without racing an
in-flight write.
Fields§
§tx: UnboundedSender<LoggedEvent>§write_lock: Arc<Mutex<()>>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Logger
impl RefUnwindSafe for Logger
impl Send for Logger
impl Sync for Logger
impl Unpin for Logger
impl UnsafeUnpin for Logger
impl UnwindSafe for Logger
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