pub struct FileLog { /* private fields */ }Expand description
Logs inbound/outbound messages to messages.log and events to event.log via a bounded
channel and background writer task (NEW-156).
Implementations§
Source§impl FileLog
impl FileLog
Sourcepub async fn open(dir: &Path) -> Result<Self, LogError>
pub async fn open(dir: &Path) -> Result<Self, LogError>
Open (creating if needed) the log files in dir with default (unfiltered) output switches.
Sourcepub async fn open_with_options(
dir: &Path,
options: FileLogOptions,
) -> Result<Self, LogError>
pub async fn open_with_options( dir: &Path, options: FileLogOptions, ) -> Result<Self, LogError>
Open (creating if needed) the log files in dir, honoring options (FR-026), and spawn
the background writer task (NEW-156). async (unlike the pre-NEW-156 synchronous
constructor) purely because spawning that task requires an active Tokio runtime, matching
RedbLog::connect/SqlLog::connect’s existing async constructors – opening the files
themselves is still a cheap, synchronous std::fs call, not offloaded to spawn_blocking.
Trait Implementations§
Source§impl Log for FileLog
impl Log for FileLog
Source§fn on_incoming(&self, message: &str)
fn on_incoming(&self, message: &str)
Log an inbound wire message.
Source§fn on_outgoing(&self, message: &str)
fn on_outgoing(&self, message: &str)
Log an outbound wire message.
Source§fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
NEW-91 (feature 009): flush any entries still buffered in an async background writer and
await its completion, so a shutdown doesn’t drop entries queued right before it. Default
no-op — every synchronous backend (
ScreenLog/FileLog/TracingLog) already persists
each entry before its on_* call returns; only the channel-backed async backends
(Sql/Mssql/Mongo/RedbLog, each behind its own Cargo feature) override this.Auto Trait Implementations§
impl !Freeze for FileLog
impl RefUnwindSafe for FileLog
impl Send for FileLog
impl Sync for FileLog
impl Unpin for FileLog
impl UnsafeUnpin for FileLog
impl UnwindSafe for FileLog
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