From 22542c4368b4b64288763138d8d1f56d62a01176 Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Mon, 26 Feb 2024 09:53:40 +0100 Subject: [PATCH] Change default log level to info --- cli/src/main.rs | 2 +- prdoclib/src/commands/check.rs | 9 +++++++-- prdoclib/src/schema.rs | 6 ++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index e7631fc..c2409d5 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -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(); diff --git a/prdoclib/src/commands/check.rs b/prdoclib/src/commands/check.rs index dbec8a0..b1104d4 100644 --- a/prdoclib/src/commands/check.rs +++ b/prdoclib/src/commands/check.rs @@ -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}, @@ -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:?}"); @@ -64,7 +69,7 @@ impl CheckCmd { } }, Err(e) => { - log::warn!("{e:?}"); + log::error!("{e:?}"); (number.into(), false) }, } diff --git a/prdoclib/src/schema.rs b/prdoclib/src/schema.rs index bba76e7..f94eab6 100644 --- a/prdoclib/src/schema.rs +++ b/prdoclib/src/schema.rs @@ -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)) }