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

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

No files matched your search

+1
View File
@@ -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
-----
+2 -1
View File
@@ -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())
});