Instrument tokio console

This commit is contained in:
durch
2022-01-20 11:17:33 +01:00
parent ecdbe034fa
commit 8b166f12f8
3 changed files with 258 additions and 12 deletions
+3
View File
@@ -55,6 +55,9 @@ validator-client = { path="../common/client-libs/validator-client", features = [
version-checker = { path="../common/version-checker" }
coconut-interface = { path = "../common/coconut-interface", optional = true }
credentials = { path = "../common/credentials", optional = true }
# validator-api needs to be built with RUSTFLAGS="--cfg tokio_unstable"
console-subscriber = { version = "0.1.1", optional = true}
cfg-if = "1.0"
[features]
coconut = ["coconut-interface", "credentials", "gateway-client/coconut"]
+5
View File
@@ -570,6 +570,11 @@ async fn run_validator_api(matches: ArgMatches<'static>) -> Result<()> {
async fn main() -> Result<()> {
println!("Starting validator api...");
cfg_if::cfg_if! {if #[cfg(feature = "console-subscriber")] {
// instriment tokio console subscriber needs RUSTFLAGS="--cfg tokio_unstable" at build time
console_subscriber::init();
}}
setup_logging();
let args = parse_args();
run_validator_api(args).await