Skip to content

Commit

Permalink
Change default log level to info (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
skunert authored Feb 27, 2024
1 parent 8cbb0ae commit 0b0d363
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::{collections::HashSet, env, path::PathBuf};

/// Main entry point of the cli
fn main() -> color_eyre::Result<()> {
env_logger::Builder::from_env(Env::default().default_filter_or("none")).init();
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
color_eyre::install()?;

let opts: Opts = Opts::parse();
Expand Down
9 changes: 7 additions & 2 deletions prdoclib/src/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
config::PRDocConfig,
doc_filename::DocFileName,
docfile::DocFile,
error::{self},
error::{self, PRdocLibError},
prdoc_source::PRDocSource,
schema::Schema,
utils::{get_numbers_from_file, get_project_root},
Expand Down Expand Up @@ -56,6 +56,11 @@ impl CheckCmd {
log::debug!("Loading was OK");
(number.into(), true)
},
Err(PRdocLibError::ValidationErrors(validation)) => {
log::info!("errors: {:#?}", validation.errors);
log::info!("missing: {:#?}", validation.missing);
(number.into(), false)
},
Err(e) => {
log::error!("Loading the schema failed:");
log::error!("{e:?}");
Expand All @@ -64,7 +69,7 @@ impl CheckCmd {
}
},
Err(e) => {
log::warn!("{e:?}");
log::error!("{e:?}");
(number.into(), false)
},
}
Expand Down
6 changes: 2 additions & 4 deletions prdoclib/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ impl Schema {
let validation_result_strict = validation.is_strictly_valid();

if !(validation_result && validation_result_strict) {
log::warn!("validation_result: {validation_result}");
log::warn!("validation_result_strict: {validation_result_strict}");
log::warn!("errors: {:#?}", validation.errors);
log::warn!("missing: {:#?}", validation.missing);
log::debug!("validation_result: {validation_result}");
log::debug!("validation_result_strict: {validation_result_strict}");
return Err(PRdocLibError::ValidationErrors(validation))
}

Expand Down

0 comments on commit 0b0d363

Please sign in to comment.