#ring-buffer #logging #data #file-data #file #log-file

ring-file

A debugging tool with ring buffer like file struture, for high-performance code development

8 releases

0.3.1 Sep 7, 2025
0.3.0 Sep 7, 2025
0.2.3 Sep 6, 2025
0.1.2 Jul 31, 2025
0.0.1 Jul 28, 2025

#524 in Debugging

Download history 635/week @ 2025-10-13 725/week @ 2025-10-20 1189/week @ 2025-10-27 1086/week @ 2025-11-03 839/week @ 2025-11-10 844/week @ 2025-11-17 646/week @ 2025-11-24 555/week @ 2025-12-01 549/week @ 2025-12-08 554/week @ 2025-12-15 565/week @ 2025-12-22 549/week @ 2025-12-29 503/week @ 2026-01-05 534/week @ 2026-01-12 466/week @ 2026-01-19 458/week @ 2026-01-26

2,047 downloads per month
Used in 2 crates (via captains-log)

MIT license

9KB
138 lines

RingFile

crates.io: crates.io docs.rs: docs.rs

The purpose of this tool is to help debug deadlock problems, that only occur under high-performance scenarios. Because writing log to disk will slow down execution, which makes deadlock hidden without racing conditions met.

This crate provides two abstraction:

RingBuffer: to store byte content in memory when written. when offset rewinds, new content will overwrite old content, so that memory consumption is limited to buf_size.

RingFile: to record log content in memory for multi-threaded program. Act as an observer to analyze concurrency problem. It maintain thread local buffer to avoid lock contention. Already integrated into captain-log as LogRingFile sink.

Dependencies

~2.5MB
~53K SLoC