tracing-indicatif

Crates.iotracing-indicatif
lib.rstracing-indicatif
version0.3.8
sourcesrc
created_at2023-02-09 06:22:25.16244
updated_at2024-12-02 08:02:15.442749
descriptionTracing layer that automatically creates and manages progress bars for active spans.
homepage
repositoryhttps://github.com/emersonford/tracing-indicatif
max_upload_size
id780543
size128,266
Emerson Ford (emersonford)

documentation

https://docs.rs/tracing-indicatif

README

tracing-indicatif

Documentation Crates.io

A tracing layer that automatically creates and manages indicatif progress bars for active spans.

Progress bars are a great way to make your CLIs feel more responsive. However, adding and managing progress bars in your libraries can be invasive, unergonomic, and difficult to keep track of.

This library aims to make it easy to show progress bars for your CLI by tying progress bars to tracing spans. For CLIs/libraries already using tracing spans, this allow for a dead simple (3 line) code change to enable a smooth progress bar experience for your program. This eliminates having to have code in your libraries to manually manage progress bar instances.

This ends up working quite well as progress bars are fundamentally tracking the lifetime of some "span" (whether that "span" is defined explicitly or implicitly), so might as well make that relationship explicit.

Demo

See the examples folder for demo code.

Default Configuration

demo using basic example

Default Configuration with Child Spans

demo using child_spans example

Progress Bar

demo using progress_bar example

Build Console Like

A recreation of buck2's superconsole. demo using build_console example

Features

  • Customize progress bars using the same ProgressStyle API as indicatif.
  • Supports displaying parent-child span relationship between progress bars.
  • Limit the number of progress bars visible on the terminal.
  • Prevents progress bars from clobbering tracing logs.
Commit count: 67

cargo fmt