Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Enable logging in the puppet worker (#3411)
Browse files Browse the repository at this point in the history
This is useful for tests where something is failing :D
  • Loading branch information
bkchr authored Jul 5, 2021
1 parent ac39b07 commit ade2058
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node/core/pvf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
3 changes: 3 additions & 0 deletions node/core/pvf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions node/core/pvf/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>();
if args.len() < 2 {
panic!("wrong number of arguments");
Expand Down

0 comments on commit ade2058

Please sign in to comment.