spannify 0.0.2

A crate that produces nice-looking graphs to visualize your callstack.
Documentation

Spannify

Build status

A tiny rust crate that produces nice-looking graphs for you to visualize your callstack

Example

 use spannify::core::StdoutSpanner;

 fn fib(s: &StdoutSpanner, x: usize) -> usize {
     let _span = s.enter_span(format!("fib({})", x).as_ref());
     match x {
         0 => 0,
         1 | 2 => 1,
         _ => fib(s, x - 1) + fib(s, x - 2),
     }
 }


 fn main() {
     let spanner = StdoutSpanner::new();

     let _ = fib(&spanner, 5);
 }

Output

┌fib(5) entered
|  fib(4) entered
|   ┌fib(3) entered
|   ┆  fib(2) entered
|   ┆  fib(2) dropped
|   ┆  fib(1) entered
|   ┆  fib(1) dropped
|   └fib(3) dropped
|   ┌fib(2) entered
|   └fib(2) dropped
|  fib(4) dropped
|  fib(3) entered
|   ┌fib(2) entered
|   └fib(2) dropped
|   ┌fib(1) entered
|   └fib(1) dropped
|  fib(3) dropped
└fib(5) dropped

Documentation

Check out the full documentation at docs.rs