added debug console logging

This commit is contained in:
Nickiel12 2024-07-04 09:03:17 -07:00
parent 58546e8432
commit 047a180664
2 changed files with 10 additions and 1 deletions

View file

@ -7,6 +7,7 @@ edition = "2021"
[features]
tracker-state-debug = []
tokio-logging = []
[dependencies]
async-channel = "2.2.0"

View file

@ -31,11 +31,19 @@ fn main() -> glib::ExitCode {
.with_ansi(false)
.init();
}
#[cfg(debug_assertions)]
#[cfg(all(not(feature = "tokio-debug"), debug_assertions))]
{
let sub = tracing_subscriber::FmtSubscriber::new();
if let Err(e) = tracing::subscriber::set_global_default(sub) {
panic!("Could not set tracing global: {e}");
}
}
#[cfg(feature = "tokio-debug")]
{
console_subscriber::init();
}
let span = tracing::span!(Level::TRACE, "main");
let _enter = span.enter();