Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
fix(flags): fix logger level flags (#575)
Browse files Browse the repository at this point in the history
Co-authored-by: maskpp <[email protected]>
Co-authored-by: David <[email protected]>
  • Loading branch information
3 people authored Feb 28, 2024
1 parent 5ade026 commit d315605
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cmd/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ func InitLogger(c *cli.Context) {
glogger.Verbosity(slogVerbosity)
log.SetDefault(log.NewLogger(glogger))
} else {
glogger := log.NewGlogHandler(log.NewTerminalHandlerWithLevel(os.Stdout, slogVerbosity, true))
glogger := log.NewGlogHandler(log.NewTerminalHandler(os.Stdout, true))
glogger.Verbosity(slogVerbosity)
log.SetDefault(log.NewLogger(glogger))
}
}
1 change: 1 addition & 0 deletions integration_test/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ check_env "L1_PROPOSER_PRIVATE_KEY"
check_env "L1_PROVER_PRIVATE_KEY"
check_env "TREASURY"
check_env "JWT_SECRET"
check_env "VERBOSITY"

RUN_TESTS=${RUN_TESTS:-false}
PACKAGE=${PACKAGE:-...}
Expand Down
4 changes: 3 additions & 1 deletion integration_test/test_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export L1_PROPOSER_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5ef
export L2_SUGGESTED_FEE_RECIPIENT=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
export L1_PROVER_PRIVATE_KEY=0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
export TREASURY=0x1670010000000000000000000000000000010001
export VERBOSITY=3

# show the integration test environment variables.
# L1_BEACON_HTTP_ENDPOINT=$L1_BEACON_HTTP_ENDPOINT
Expand All @@ -46,4 +47,5 @@ L1_SECURITY_COUNCIL_PRIVATE_KEY=$L1_SECURITY_COUNCIL_PRIVATE_KEY
L1_PROPOSER_PRIVATE_KEY=$L1_PROPOSER_PRIVATE_KEY
L1_PROVER_PRIVATE_KEY=$L1_PROVER_PRIVATE_KEY
TREASURY=$TREASURY
JWT_SECRET=$JWT_SECRET" > integration_test/.env
JWT_SECRET=$JWT_SECRET
VERBOSITY=$VERBOSITY" > integration_test/.env
6 changes: 5 additions & 1 deletion internal/testutils/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"math/big"
"net/url"
"os"
"strconv"

"github.com/cenkalti/backoff/v4"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
Expand Down Expand Up @@ -35,7 +36,10 @@ type ClientTestSuite struct {
func (s *ClientTestSuite) SetupTest() {
utils.LoadEnv()
// Default logger
glogger := log.NewGlogHandler(log.NewTerminalHandlerWithLevel(os.Stdout, log.LevelInfo, true))
ver, err := strconv.Atoi(os.Getenv("VERBOSITY"))
s.Nil(err)
glogger := log.NewGlogHandler(log.NewTerminalHandler(os.Stdout, true))
glogger.Verbosity(log.FromLegacyLevel(ver))
log.SetDefault(log.NewLogger(glogger))

testAddrPrivKey, err := crypto.ToECDSA(common.FromHex(os.Getenv("L1_PROPOSER_PRIVATE_KEY")))
Expand Down

0 comments on commit d315605

Please sign in to comment.