| Vulnerabilities | |||||
|---|---|---|---|---|---|
| Version | Suggest | Low | Medium | High | Critical |
| 1.4.0 | 0 | 0 | 0 | 0 | 0 |
| 1.3.0 | 0 | 0 | 0 | 0 | 0 |
| 1.2.1 | 0 | 0 | 0 | 0 | 0 |
| 1.2.0 | 0 | 0 | 0 | 0 | 0 |
| 1.1.1 | 0 | 0 | 0 | 0 | 0 |
| 1.1.0 | 0 | 0 | 0 | 0 | 0 |
| 1.0.6 | 0 | 0 | 0 | 0 | 0 |
| 1.0.5 | 0 | 0 | 0 | 0 | 0 |
| 1.0.4 | 0 | 0 | 0 | 0 | 0 |
| 1.0.3 | 0 | 0 | 0 | 0 | 0 |
| 1.0.2 | 0 | 0 | 0 | 0 | 0 |
| 1.0.1 | 0 | 0 | 0 | 0 | 0 |
| 1.0.0 | 0 | 0 | 0 | 0 | 0 |
| 0.1.3 | 0 | 0 | 0 | 0 | 0 |
| 0.1.2 | 0 | 0 | 0 | 0 | 0 |
| 0.1.1 | 0 | 0 | 0 | 0 | 0 |
| 0.1.0 | 0 | 0 | 0 | 0 | 0 |
1.4.0 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform
Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.
MIT - MIT LicenseA 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.
log crateThe crate offers a global progress bar interface for convenience, so you don't have to manually manage ProgressBar instances.
use progress_bar::*;
use std::{thread::sleep, time::Duration};
// if you have 81 pages to load
init_progress_bar(81);
set_progress_bar_action("Loading", Color::Blue, Style::Bold);
for i in 0..81 {
// load page
sleep(Duration::from_millis(100));
// log the result
if i == 14 {
print_progress_bar_info("Failed", "to load https://zefzef.zef", Color::Red, Style::Normal);
} else if i == 41 {
print_progress_bar_info("Success", "loading https://example.com", Color::Green, Style::Bold);
}
// increase the progress by 1
inc_progress_bar();
}
finalize_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 progress_bar::*;
init_progress_bar(100);
print_progress_bar_info("Loading", "website https://example.com", Color::Blue, Style::Bold);
print_progress_bar_info("Failed", "to load https://zefzef.zef", Color::Red, Style::Normal);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
progress_bar = { version = "*", features = ["logger"] }use progress_bar::*;
use log::*;
init_logger().unwrap();
init_progress_bar(100);
info!("Loading website https://example.com");
warn!("Failed to load https://zefzef.zef");It is also possible to set another logger to handle calls to logging functions, while
use progress_bar::*;
use env_logger::Env;
use log::*;
let inner = env_logger::Builder::from_env(Env::default()).build();
init_logger_with_inner(inner).unwrap();
info!("Loading website https://example.com");
warn!("Failed to load https://zefzef.zef");License: MIT