Skip to content

Commit

Permalink
Humanize user-faced messages
Browse files Browse the repository at this point in the history
  • Loading branch information
KonishchevDmitry committed Aug 2, 2024
1 parent 5cb596a commit 8d9a7ca
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bzip2 = "0.4.4"
chrono = "0.4.38"
clap = "4.5.11"
const_format = "0.2.32"
easy-logging = "0.2.0"
easy-logging = "1"
flate2 = "1.0"
globset = "0.4.14"
http = "1.1.0"
Expand All @@ -36,4 +36,4 @@ validator = { version = "0.18.1", features = ["derive"] }

[dev-dependencies]
indoc = "2.0.5"
rstest = "0.21.0"
rstest = "0.21.0"
5 changes: 2 additions & 3 deletions src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::time::SystemTime;
use easy_logging::GlobalContext;
use globset::GlobMatcher;
use itertools::Itertools;
use log::{debug, info, error};
use log::{Level, debug, info, error};
use semver::Version;
use url::Url;

Expand Down Expand Up @@ -43,10 +43,9 @@ pub fn install(config: &Config, mode: Mode, names: Option<Vec<String>>) -> Empty
};

for (name, tool) in tools {
let _logging_context = GlobalContext::new(name);
let _logging_context = GlobalContext::new_conditional(Level::Debug, name);

if names.is_none() {
// FIXME(konishchev): Humanize logging
info!("Checking {name}...");
}

Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::io::{self, Write};
use std::path::Path;
use std::process;

use easy_logging::LoggingConfig;
use log::error;

use crate::cli::Action;
Expand All @@ -24,7 +25,7 @@ fn main() {
process::exit(1);
});

if let Err(e) = easy_logging::init(module_path!().split("::").next().unwrap(), args.log_level) {
if let Err(e) = LoggingConfig::new(module_path!(), args.log_level).minimal().build() {
let _ = writeln!(io::stderr(), "Failed to initialize the logging: {}.", e);
process::exit(1);
}
Expand Down

0 comments on commit 8d9a7ca

Please sign in to comment.