diff --git a/server.sh b/server.sh index 39ed75f..4ad7090 100755 --- a/server.sh +++ b/server.sh @@ -10,7 +10,7 @@ shift DB=./db2 # $HOME/tmp/electrs_db/mainnet_zstd CMD="target/release/electrs --network $NETWORK --db-dir $DB --daemon-dir $HOME/.bitcoin" -export RUST_LOG=${RUST_LOG-info} +# export RUST_LOG=${RUST_LOG-info} $CMD $* # use SIGINT to quit diff --git a/src/config.rs b/src/config.rs index 0ff4d50..17192a4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -267,6 +267,12 @@ impl Config { } }); + let level = match config.verbose { + 0 => log::LevelFilter::Info, + 1 => log::LevelFilter::Debug, + _ => log::LevelFilter::Trace, + }; + let config = Config { network: config.network, db_path: config.db_dir, @@ -286,6 +292,7 @@ impl Config { env_logger::Builder::from_default_env() .default_format() .format_timestamp_millis() + .filter_level(level) .init(); config }