From 44559109f0177a021260f74ebd715d78fbb6d313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Drozd?= Date: Mon, 10 Oct 2022 13:25:19 +0200 Subject: [PATCH] p2w-client: Remove --log-level, rely on RUST_LOG, provide default (#333) --- solana/pyth2wormhole/client/src/cli.rs | 7 ------- third_party/pyth/p2w_autoattest.py | 13 ++++--------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/solana/pyth2wormhole/client/src/cli.rs b/solana/pyth2wormhole/client/src/cli.rs index 05fc19c0..b0a80ce7 100644 --- a/solana/pyth2wormhole/client/src/cli.rs +++ b/solana/pyth2wormhole/client/src/cli.rs @@ -15,13 +15,6 @@ use clap::{ author = "Pyth Network Contributors" )] pub struct Cli { - #[clap( - short, - long, - default_value = "3", - help = "Logging level, where 0..=1 RUST_LOG=error and 5.. is RUST_LOG=trace" - )] - pub log_level: u32, #[clap( long, help = "Identity JSON file for the entity meant to cover transaction costs", diff --git a/third_party/pyth/p2w_autoattest.py b/third_party/pyth/p2w_autoattest.py index f80d0e8d..9e4875fa 100755 --- a/third_party/pyth/p2w_autoattest.py +++ b/third_party/pyth/p2w_autoattest.py @@ -112,8 +112,6 @@ if P2W_INITIALIZE_SOL_CONTRACT is not None: init_result = run_or_die( [ "pyth2wormhole-client", - "--log-level", - "4", "--p2w-addr", P2W_SOL_ADDRESS, "--rpc-url", @@ -139,8 +137,6 @@ if P2W_INITIALIZE_SOL_CONTRACT is not None: run_or_die( [ "pyth2wormhole-client", - "--log-level", - "4", "--p2w-addr", P2W_SOL_ADDRESS, "--rpc-url", @@ -245,14 +241,16 @@ symbol_groups: f.flush() +# Set helpfully chatty logging default, filtering especially annoying +# modules like async HTTP requests and tokio runtime logs +os.environ["RUST_LOG"] = os.environ.get("RUST_LOG", "pyth2wormhole_client,solana_client,main,pyth_sdk_solana=trace") + # Send the first attestation in one-shot mode for testing first_attest_result = run_or_die( [ "pyth2wormhole-client", "--commitment", "confirmed", - "--log-level", - "3", "--p2w-addr", P2W_SOL_ADDRESS, "--rpc-url", @@ -278,7 +276,6 @@ endpoint_thread.start() readiness_thread = threading.Thread(target=readiness, daemon=True) readiness_thread.start() - # Do not exit this script if a continuous attestation stops for # whatever reason (this avoids k8s restart penalty) while True: @@ -288,8 +285,6 @@ while True: "pyth2wormhole-client", "--commitment", "confirmed", - "--log-level", - "3", "--p2w-addr", P2W_SOL_ADDRESS, "--rpc-url",