瀏覽代碼

p2w-client: Remove --log-level, rely on RUST_LOG, provide default (#333)

Stanisław Drozd 3 年之前
父節點
當前提交
44559109f0
共有 2 個文件被更改,包括 4 次插入16 次删除
  1. 0 7
      solana/pyth2wormhole/client/src/cli.rs
  2. 4 9
      third_party/pyth/p2w_autoattest.py

+ 0 - 7
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",

+ 4 - 9
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",