From c4d45c97ddf73298322f0212ad00f2612bb4573b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 5 Jul 2021 14:18:20 +0200 Subject: [PATCH] Enable logging in the puppet worker (#3411) This is useful for tests where something is failing :D --- polkadot/Cargo.lock | 1 + polkadot/node/core/pvf/Cargo.toml | 1 + polkadot/node/core/pvf/src/lib.rs | 3 +++ polkadot/node/core/pvf/src/testing.rs | 2 ++ 4 files changed, 7 insertions(+) diff --git a/polkadot/Cargo.lock b/polkadot/Cargo.lock index 05d9b0f5f8..0d016ce665 100644 --- a/polkadot/Cargo.lock +++ b/polkadot/Cargo.lock @@ -6234,6 +6234,7 @@ dependencies = [ "sp-externalities", "sp-io", "sp-maybe-compressed-blob", + "sp-tracing", "sp-wasm-interface", "tempfile", "test-parachain-adder", diff --git a/polkadot/node/core/pvf/Cargo.toml b/polkadot/node/core/pvf/Cargo.toml index b6415078b0..23388b28da 100644 --- a/polkadot/node/core/pvf/Cargo.toml +++ b/polkadot/node/core/pvf/Cargo.toml @@ -31,6 +31,7 @@ sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-wasm-interface = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-maybe-compressed-blob = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" } [dev-dependencies] adder = { package = "test-parachain-adder", path = "../../../parachain/test-parachains/adder" } diff --git a/polkadot/node/core/pvf/src/lib.rs b/polkadot/node/core/pvf/src/lib.rs index d29887edba..b65d5797ce 100644 --- a/polkadot/node/core/pvf/src/lib.rs +++ b/polkadot/node/core/pvf/src/lib.rs @@ -88,6 +88,9 @@ mod worker_common; #[doc(hidden)] pub mod testing; +#[doc(hidden)] +pub use sp_tracing; + pub use error::{ValidationError, InvalidCandidate}; pub use priority::Priority; pub use pvf::Pvf; diff --git a/polkadot/node/core/pvf/src/testing.rs b/polkadot/node/core/pvf/src/testing.rs index 9c14ad8bd0..35ba80c1bd 100644 --- a/polkadot/node/core/pvf/src/testing.rs +++ b/polkadot/node/core/pvf/src/testing.rs @@ -50,6 +50,8 @@ pub fn validate_candidate( macro_rules! decl_puppet_worker_main { () => { fn main() { + $crate::sp_tracing::try_init_simple(); + let args = std::env::args().collect::>(); if args.len() < 2 { panic!("wrong number of arguments");