If log level set to 'trace' then set this level for the Bliss library too.

Issue 
This commit is contained in:
CDrummond 2025-03-05 17:09:52 +00:00
parent 1e00e9593a
commit 786b7d2c2d
2 changed files with 3 additions and 1 deletions

@ -9,6 +9,7 @@
5. If new files analysed and 'ignore' file exists then update DB's 'ignore'
flags.
6. Add option to write analysis results to files, and use for future scans.
7. If log level set to 'trace' then set this level for the Bliss library too.
0.2.3
-----

@ -84,8 +84,9 @@ fn main() {
|| logging.eq_ignore_ascii_case("warn") || logging.eq_ignore_ascii_case("error")) {
logging = String::from("info");
}
let bliss_level = if logging.eq_ignore_ascii_case("trace") { LevelFilter::Trace } else { LevelFilter::Error };
let mut builder = env_logger::Builder::from_env(env_logger::Env::default().filter_or("XXXXXXXX", logging));
builder.filter(Some("bliss_audio"), LevelFilter::Error);
builder.filter(Some("bliss_audio"), bliss_level);
builder.format(|buf, record| {
writeln!(buf, "[{} {:.1}] {}", Local::now().format("%Y-%m-%d %H:%M:%S"), record.level(), record.args())
});