mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 22:30:03 +00:00
Ignore trust_dns
log output (#323)
* Ignore all log except `binstall` & `cargo_binstall` unless `level` is set to `Trace` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
305cda3336
commit
f38c1e73c3
1 changed files with 9 additions and 4 deletions
|
@ -103,14 +103,19 @@ impl UIThread {
|
|||
}
|
||||
|
||||
pub fn logging(args: &Args) {
|
||||
let log_level = args.log_level;
|
||||
|
||||
// Setup logging
|
||||
let mut log_config = ConfigBuilder::new();
|
||||
log_config.add_filter_ignore("hyper".to_string());
|
||||
log_config.add_filter_ignore("reqwest".to_string());
|
||||
log_config.add_filter_ignore("rustls".to_string());
|
||||
|
||||
if log_level != LevelFilter::Trace {
|
||||
log_config.add_filter_allow_str("binstall");
|
||||
log_config.add_filter_allow_str("cargo_binstall");
|
||||
}
|
||||
|
||||
log_config.set_location_level(LevelFilter::Off);
|
||||
TermLogger::init(
|
||||
args.log_level,
|
||||
log_level,
|
||||
log_config.build(),
|
||||
TerminalMode::Mixed,
|
||||
ColorChoice::Auto,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue