Skip to content

Commit 4455910

Browse files
author
Stanisław Drozd
authored
p2w-client: Remove --log-level, rely on RUST_LOG, provide default (#333)
1 parent 207616d commit 4455910

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

solana/pyth2wormhole/client/src/cli.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ use clap::{
1515
author = "Pyth Network Contributors"
1616
)]
1717
pub struct Cli {
18-
#[clap(
19-
short,
20-
long,
21-
default_value = "3",
22-
help = "Logging level, where 0..=1 RUST_LOG=error and 5.. is RUST_LOG=trace"
23-
)]
24-
pub log_level: u32,
2518
#[clap(
2619
long,
2720
help = "Identity JSON file for the entity meant to cover transaction costs",

third_party/pyth/p2w_autoattest.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ def find_and_log_seqnos(s):
112112
init_result = run_or_die(
113113
[
114114
"pyth2wormhole-client",
115-
"--log-level",
116-
"4",
117115
"--p2w-addr",
118116
P2W_SOL_ADDRESS,
119117
"--rpc-url",
@@ -139,8 +137,6 @@ def find_and_log_seqnos(s):
139137
run_or_die(
140138
[
141139
"pyth2wormhole-client",
142-
"--log-level",
143-
"4",
144140
"--p2w-addr",
145141
P2W_SOL_ADDRESS,
146142
"--rpc-url",
@@ -245,14 +241,16 @@ def find_and_log_seqnos(s):
245241
f.flush()
246242

247243

244+
# Set helpfully chatty logging default, filtering especially annoying
245+
# modules like async HTTP requests and tokio runtime logs
246+
os.environ["RUST_LOG"] = os.environ.get("RUST_LOG", "pyth2wormhole_client,solana_client,main,pyth_sdk_solana=trace")
247+
248248
# Send the first attestation in one-shot mode for testing
249249
first_attest_result = run_or_die(
250250
[
251251
"pyth2wormhole-client",
252252
"--commitment",
253253
"confirmed",
254-
"--log-level",
255-
"3",
256254
"--p2w-addr",
257255
P2W_SOL_ADDRESS,
258256
"--rpc-url",
@@ -278,7 +276,6 @@ def find_and_log_seqnos(s):
278276
readiness_thread = threading.Thread(target=readiness, daemon=True)
279277
readiness_thread.start()
280278

281-
282279
# Do not exit this script if a continuous attestation stops for
283280
# whatever reason (this avoids k8s restart penalty)
284281
while True:
@@ -288,8 +285,6 @@ def find_and_log_seqnos(s):
288285
"pyth2wormhole-client",
289286
"--commitment",
290287
"confirmed",
291-
"--log-level",
292-
"3",
293288
"--p2w-addr",
294289
P2W_SOL_ADDRESS,
295290
"--rpc-url",

0 commit comments

Comments
 (0)