Skip to content

Repository files navigation

ttlog

ttlog

Lock-free structured logging for Rust. Ring buffers, thread-local string interning, compressed crash snapshots.

MIT - Changelog - Contributing - crates.io - docs.rs

crates.io docs.rs MIT


Install

cargo add ttlog

Quick start

use ttlog::{Logger, LogLevel};

let log = Logger::new();
log.info("startup", &[("port", "8080"), ("env", "prod")]);
log.warn("slow query", &[("ms", "850")]);
log.error("upstream 503", &[("path", "/api/users")]);

Drop-in replacement for tracing or log in hot paths where allocation matters. Compressed snapshots on panic so you can replay.

Workspace

Crate Role
ttlog Core logger + ring buffers
ttlog-macros #[trace_fn], log! macros
ttlog-view Snapshot reader / pretty printer
ttlog-benches Criterion suite

Examples

Path Stack
examples/ttlog-simple Basic events, levels, crash snapshot
examples/ttlog-filereader Replay snapshot via ttlog-view

Build

cargo build --release --workspace
cargo test  --workspace
cargo bench -p ttlog-benches

Docs

Benchmarks

Numbers from ttlog-benches. Re-run on your hardware before quoting.

metric value
throughput 318M events/sec @ 16 threads
buffer ops 15M ops/sec (producer-heavy)
memory 24 bytes per event
concurrency 256+ threads tested

Contributing

PR checklist + style notes in CONTRIBUTING.md. Security: SECURITY.md. Behaviour: CODE_OF_CONDUCT.md.

License

MIT. See LICENSE.

About

High-performance, lock-free, non-blocking ring-buffer logger for Rust with compressed disk snapshots for post-mortem debugging.

Resources

Code of conduct

Contributing

Security policy

Stars

14 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages