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

This commit is contained in:
Stanisław Drozd 2022-10-10 13:25:19 +02:00 committed by GitHub
parent 207616d47c
commit 44559109f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 16 deletions

View File

@ -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",

View File

@ -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",