added debug console logging
This commit is contained in:
parent
58546e8432
commit
047a180664
2 changed files with 10 additions and 1 deletions
|
@ -7,6 +7,7 @@ edition = "2021"
|
|||
|
||||
[features]
|
||||
tracker-state-debug = []
|
||||
tokio-logging = []
|
||||
|
||||
[dependencies]
|
||||
async-channel = "2.2.0"
|
||||
|
|
10
src/main.rs
10
src/main.rs
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue