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

Commit d315605

Browse files
RogerLamTdmask-ppdavidtaikocha
authored
fix(flags): fix logger level flags (#575)
Co-authored-by: maskpp <maskpp266@gmail.com> Co-authored-by: David <david@taiko.xyz>
1 parent 5ade026 commit d315605

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

cmd/logger/logger.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ func InitLogger(c *cli.Context) {
1919
glogger.Verbosity(slogVerbosity)
2020
log.SetDefault(log.NewLogger(glogger))
2121
} else {
22-
glogger := log.NewGlogHandler(log.NewTerminalHandlerWithLevel(os.Stdout, slogVerbosity, true))
22+
glogger := log.NewGlogHandler(log.NewTerminalHandler(os.Stdout, true))
23+
glogger.Verbosity(slogVerbosity)
2324
log.SetDefault(log.NewLogger(glogger))
2425
}
2526
}

integration_test/entrypoint.sh

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ check_env "L1_PROPOSER_PRIVATE_KEY"
4141
check_env "L1_PROVER_PRIVATE_KEY"
4242
check_env "TREASURY"
4343
check_env "JWT_SECRET"
44+
check_env "VERBOSITY"
4445

4546
RUN_TESTS=${RUN_TESTS:-false}
4647
PACKAGE=${PACKAGE:-...}

integration_test/test_env.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export L1_PROPOSER_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5ef
2222
export L2_SUGGESTED_FEE_RECIPIENT=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
2323
export L1_PROVER_PRIVATE_KEY=0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
2424
export TREASURY=0x1670010000000000000000000000000000010001
25+
export VERBOSITY=3
2526

2627
# show the integration test environment variables.
2728
# L1_BEACON_HTTP_ENDPOINT=$L1_BEACON_HTTP_ENDPOINT
@@ -46,4 +47,5 @@ L1_SECURITY_COUNCIL_PRIVATE_KEY=$L1_SECURITY_COUNCIL_PRIVATE_KEY
4647
L1_PROPOSER_PRIVATE_KEY=$L1_PROPOSER_PRIVATE_KEY
4748
L1_PROVER_PRIVATE_KEY=$L1_PROVER_PRIVATE_KEY
4849
TREASURY=$TREASURY
49-
JWT_SECRET=$JWT_SECRET" > integration_test/.env
50+
JWT_SECRET=$JWT_SECRET
51+
VERBOSITY=$VERBOSITY" > integration_test/.env

internal/testutils/suite.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"math/big"
77
"net/url"
88
"os"
9+
"strconv"
910

1011
"github.com/cenkalti/backoff/v4"
1112
"github.com/ethereum/go-ethereum/accounts/abi/bind"
@@ -35,7 +36,10 @@ type ClientTestSuite struct {
3536
func (s *ClientTestSuite) SetupTest() {
3637
utils.LoadEnv()
3738
// Default logger
38-
glogger := log.NewGlogHandler(log.NewTerminalHandlerWithLevel(os.Stdout, log.LevelInfo, true))
39+
ver, err := strconv.Atoi(os.Getenv("VERBOSITY"))
40+
s.Nil(err)
41+
glogger := log.NewGlogHandler(log.NewTerminalHandler(os.Stdout, true))
42+
glogger.Verbosity(log.FromLegacyLevel(ver))
3943
log.SetDefault(log.NewLogger(glogger))
4044

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

0 commit comments

Comments
 (0)