Make tokio-console feature flag actually work

This commit is contained in:
Igor Katson 2024-08-29 00:35:03 +01:00
parent 6182d94ce4
commit edba359400
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
5 changed files with 16 additions and 5 deletions

View file

@ -91,6 +91,13 @@ pub fn init_logging(opts: InitLoggingOptions) -> anyhow::Result<InitLoggingResul
.with_writer(line_sub)
.with_filter(EnvFilter::builder().parse("info,librqbit=debug").unwrap()),
);
#[cfg(feature = "tokio-console")]
let console_layer = console_subscriber::spawn();
#[cfg(feature = "tokio-console")]
let layered = layered.with(console_layer);
if let Some(log_file) = &opts.log_file {
let log_file = log_file.to_string();
let log_file = std::sync::Mutex::new(LineWriter::new(