Crates.io | tracing-indicatif |
lib.rs | tracing-indicatif |
version | 0.3.8 |
source | src |
created_at | 2023-02-09 06:22:25.16244 |
updated_at | 2024-12-02 08:02:15.442749 |
description | Tracing layer that automatically creates and manages progress bars for active spans. |
homepage | |
repository | https://github.com/emersonford/tracing-indicatif |
max_upload_size | |
id | 780543 |
size | 128,266 |
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.
See the examples
folder for demo code.
A recreation of buck2
's superconsole.
ProgressStyle
API as indicatif.