Make tokio-console feature flag actually work
This commit is contained in:
parent
6182d94ce4
commit
edba359400
5 changed files with 16 additions and 5 deletions
|
|
@ -13,6 +13,7 @@ readme = "README.md"
|
|||
|
||||
[features]
|
||||
default = ["default-tls"]
|
||||
tokio-console = ["console-subscriber", "tokio/tracing"]
|
||||
http-api = ["axum", "tower-http"]
|
||||
upnp-serve-adapter = ["upnp-serve"]
|
||||
webui = []
|
||||
|
|
@ -59,6 +60,7 @@ tokio = { version = "1", features = [
|
|||
"fs",
|
||||
"io-util",
|
||||
] }
|
||||
console-subscriber = { version = "0.4", optional = true }
|
||||
axum = { version = "0.7", optional = true }
|
||||
tower-http = { version = "0.5", features = ["cors", "trace"], optional = true }
|
||||
tokio-stream = "0.1"
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ readme = "README.md"
|
|||
[features]
|
||||
default = ["default-tls", "postgres", "webui"]
|
||||
openssl-vendored = ["openssl/vendored"]
|
||||
tokio-console = ["console-subscriber", "tokio/tracing"]
|
||||
tokio-console = ["librqbit/tokio-console"]
|
||||
webui = ["librqbit/webui"]
|
||||
timed_existence = ["librqbit/timed_existence"]
|
||||
default-tls = ["librqbit/default-tls"]
|
||||
|
|
@ -27,7 +27,7 @@ librqbit = { version = "7.0.0", path = "../librqbit", default-features = false,
|
|||
"http-api",
|
||||
"tracing-subscriber-utils",
|
||||
"upnp-serve-adapter",
|
||||
]}
|
||||
] }
|
||||
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
||||
console-subscriber = { version = "0.4", optional = true }
|
||||
anyhow = "1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue