progress_bar
A simple and elegant crate for displaying progress bars in the terminal. It can estimate and display the remaining time, and includes logging utilities that integrate cleanly with your progress bar output.
⚠️ Note: This crate currently supports Unix-based systems only.
Features
- Display a clean terminal progress bar
- Show the current action to the left of the progress bar
- Output log messages above the progress bar
- Estimate and display remaining time
- Integrate seamlessly with Rust’s
logcrate
Example
Using the global progress bar
The crate offers a global progress bar interface for convenience, so you don't have to manually manage ProgressBar instances.
use *;
use ;
// if you have 81 pages to load
init_progress_bar;
set_progress_bar_action;
for i in 0..81
finalize_progress_bar;

Logging with the progress bar
Calls to print while a progress bar is active will mess with the output.
To avoid this, you can use the print_progress_bar_info function to log messages while the progress bar is active.
use *;
init_progress_bar;
print_progress_bar_info;
print_progress_bar_info;
If you find this syntax too verbose, the crate allows you to use the progress bar as a logger directly.
Enable to logger feature to use this functionality.
# Add the logger feature in your Cargo.toml
= { = "*", = ["logger"] }
use *;
use *;
init_logger.unwrap;
init_progress_bar;
info!;
warn!;
It is also possible to set another logger as a fallback to handle calls to logging functions when no progress bar is active. This fallback logger also gives you control over which messages are logged, as its [log::Log::enabled] function is used even when a progress bar is active.
use *;
use Env;
use *;
let fallback = from_env.build;
init_logger_with_fallback.unwrap;
info!;
init_progress_bar;
info!;
warn!;
License: MIT