From f5089b55634ebd4e99785fc2b8b9b52db7090ddf Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Wed, 13 May 2020 21:12:26 +0000 Subject: [PATCH] [node.sh] add -L to set logging verbosity level Signed-off-by: Leo Chen --- scripts/node.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/node.sh b/scripts/node.sh index c35c5788bc..f8f2fed251 100755 --- a/scripts/node.sh +++ b/scripts/node.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -version="v1 20200507.0" +version="v1 20200513.0" unset -v progname progname="${0##*/}" @@ -188,6 +188,7 @@ options: -r address start a pprof profiling server listening on the specified address -I use statically linked Harmony binary (default: true) -R tracefile enable p2p trace using tracefile (default: off) + -L log_level logging verbosity: 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail (default: $log_level) examples: @@ -239,7 +240,7 @@ BUCKET=pub.harmony.one OS=$(uname -s) unset start_clean loop run_as_root blspass do_not_download download_only network node_type shard_id download_harmony_db db_file_to_dl -unset upgrade_rel public_rpc staking_mode pub_port multi_key blsfolder blacklist verify TRACEFILE minpeers max_bls_keys_per_node +unset upgrade_rel public_rpc staking_mode pub_port multi_key blsfolder blacklist verify TRACEFILE minpeers max_bls_keys_per_node log_level start_clean=false loop=true run_as_root=true @@ -260,12 +261,13 @@ static=true verify=false minpeers=6 max_bls_keys_per_node=10 +log_level=3 ${BLSKEYFILE=} ${TRACEFILE=} unset OPTIND OPTARG opt OPTIND=1 -while getopts :1chk:sSp:dDN:T:i:ba:U:PvVyzn:MAIB:r:Y:f:R:m: opt +while getopts :1chk:sSp:dDN:T:i:ba:U:PvVyzn:MAIB:r:Y:f:R:m:L: opt do case "${opt}" in '?') usage "unrecognized option -${OPTARG}";; @@ -302,6 +304,7 @@ do y) staking_mode=false;; A) archival=true;; R) TRACEFILE="${OPTARG}";; + L) log_level="${OPTARG}";; *) err 70 "unhandled option -${OPTARG}";; # EX_SOFTWARE esac done @@ -911,6 +914,7 @@ do -blacklist="${blacklist}" -min_peers="${minpeers}" -max_bls_keys_per_node="${max_bls_keys_per_node}" + -verbosity="${log_level}" ) args+=( -is_archival="${archival}"