Registry / logging / indicatif-log-bridge

indicatif-log-bridge

JSON →
library0.2.3rscratesunverified

Bridge the log crate and indicatif to stop log lines from mixing up with progress bars.

# Cargo.toml [dependencies] indicatif-log-bridge = "0.2.3"
INSTALL
IMPORT
SIG · INDICATIF-LOG-BRID
I
indicatif-log-bridge
loggingrustv0.2.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LogWrapper
use indicatif_log_bridge::LogWrapper;

Integrate log messages with indicatif progress bars to avoid output corruption.

use indicatif_log_bridge::LogWrapper; use indicatif::ProgressBar; use log::info; fn main() { let pb = ProgressBar::new(100); let log_wrapper = LogWrapper::new(pb.clone()); log::set_boxed_logger(Box::new(log_wrapper)).unwrap(); log::set_max_level(log::LevelFilter::Info); info!("This message won't mess up the progress bar."); pb.finish(); }
Debug
Known issues
gotchaMust set the logger before any log output; otherwise, log messages may still interfere.
fix
Initialize the LogWrapper early in main, before any logging occurs.
affects: >=0.1.0
Upgrade
Version history
0.2.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
16
Amazon
1
Bingbot
1
Resources
indicatif-log-bridge — cargo add indicatif-log-bridge · libregistry