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

tree-logger

Simple yet feature-full logging and profile tool

4 releases

Uses new Rust 2024

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

#38 in #true

Download history 155/week @ 2025-04-07 163/week @ 2025-04-14

318 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
~43K SLoC