#logging #tree #profile #tool #true #tree-logger

tree-logger

Simple yet feature-full logging and profile tool

3 releases

Uses new Rust 2024

new 0.1.2 Apr 14, 2025
0.1.1 Apr 12, 2025
0.1.0 Apr 12, 2025

#52 in #true

46 downloads per month

MIT license

40KB
363 lines

tree-logger

Log and profile nested code. Supports multi-threading.

Basic usage

use tree_logger::{TreeLogger, profile};

TreeLogger::new()
    .with_colors(true)
    .with_threads(true)
    .init()
    .unwrap();

log::warn!("This is an example message.");
profile!("Some parent span", || {
    log::info!("Hello from inside the parent span!");
});

Caveats

Not much time has been put into making this as performant as it could be (yet!). It's a simple solution that makes a reasonable set of assumptions. If you think you could do better you're probably right :)

Dependencies

~0.5–7MB
~44K SLoC