Skip to main content

Module trace_writer

Module trace_writer 

Source
Expand description

Shared buffered trace log writer with flush-on-exit support.

Provides a BufWriter-backed file writer wrapped in Arc<Mutex<..>> so the tracing fmt::layer can write efficiently (batched syscalls) while still allowing an explicit flush_trace_log() call on process exit or signal.

Structs§

FlushableWriter
A clonable, thread-safe buffered writer that implements std::io::Write so it can be passed directly to tracing_subscriber::fmt::layer().with_writer(..).

Functions§

flush_trace_log
Flush the global trace log writer to disk.