diff --git a/mixnode/Cargo.toml b/mixnode/Cargo.toml index 25a6a8d5a7..4979051b72 100644 --- a/mixnode/Cargo.toml +++ b/mixnode/Cargo.toml @@ -35,6 +35,7 @@ serde_json = { workspace = true } sysinfo = "0.27.7" tokio = { workspace = true, features = ["rt-multi-thread", "net", "signal"] } tokio-util = { workspace = true, features = ["codec"] } +console-subscriber = { version = "0.2", optional = true } toml = "0.5.8" url = { workspace = true, features = ["serde"] } cfg-if = "1.0.0" @@ -83,6 +84,9 @@ cpucycles = [ "nym-bin-common/tracing", ] +# build with RUSTFLAGS="--cfg tokio_unstable" +tokio-console = ["console-subscriber", "tokio/tracing"] + [package.metadata.deb] name = "nym-mixnode" maintainer-scripts = "debian" diff --git a/mixnode/src/main.rs b/mixnode/src/main.rs index d6383477cc..b9b1db4255 100644 --- a/mixnode/src/main.rs +++ b/mixnode/src/main.rs @@ -53,6 +53,12 @@ fn test_function() { #[tokio::main] async fn main() -> anyhow::Result<()> { + cfg_if::cfg_if! { + if #[cfg(feature = "tokio-console")] { + console_subscriber::init(); + } + } + let args = Cli::parse(); setup_env(args.config_env_file.as_ref());