Merge pull request #79 from pop-os/tracing-directive_jammy

This commit is contained in:
Victoria Brekenfeld 2023-02-27 21:48:38 +01:00 committed by GitHub
commit 4890bfb029
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,11 @@ 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) {
"debug"
} else {
"info"
};
let filter = EnvFilter::try_from_default_env()
.unwrap_or_else(|_| {
EnvFilter::new(if cfg!(debug_assertions) {
@ -18,17 +23,8 @@ pub fn init_logger() -> Result<()> {
})
})
.add_directive(Directive::from_str("cosmic_text=error").unwrap())
.add_directive(
Directive::from_str(&format!(
"smithay={level},cosmic_comp={level}",
level = if cfg!(debug_assertions) {
"debug"
} else {
"info"
}
))
.unwrap(),
);
.add_directive(Directive::from_str(&format!("smithay={compositor_level}")).unwrap())
.add_directive(Directive::from_str(&format!("cosmic_comp={compositor_level}")).unwrap());
let fmt_layer = fmt::layer().compact();