Merge pull request #82 from pop-os/fix-log_jammy

fix(init_logger): Directive::from_str expects warn
This commit is contained in:
Victoria Brekenfeld 2023-02-28 11:44:44 +01:00 committed by GitHub
commit 869e28532f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,22 +9,22 @@ use tracing_journald as journald;
use tracing_subscriber::{filter::Directive, fmt, prelude::*, EnvFilter};
pub fn init_logger() -> Result<()> {
let compositor_level = if cfg!(debug_assertions) {
let level = if cfg!(debug_assertions) {
"debug"
} else {
"info"
"warn"
};
let filter = EnvFilter::try_from_default_env()
.unwrap_or_else(|_| {
EnvFilter::new(if cfg!(debug_assertions) {
"warning"
"warn"
} else {
"error"
})
})
.add_directive(Directive::from_str("cosmic_text=error").unwrap())
.add_directive(Directive::from_str(&format!("smithay={compositor_level}")).unwrap())
.add_directive(Directive::from_str(&format!("cosmic_comp={compositor_level}")).unwrap());
.add_directive(Directive::from_str(&format!("smithay={level}")).unwrap())
.add_directive(Directive::from_str(&format!("cosmic_comp={level}")).unwrap());
let fmt_layer = fmt::layer().compact();