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

Commit

Permalink
feat: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Jan 31, 2024
1 parent 7c622fa commit d5a3990
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
18 changes: 5 additions & 13 deletions cmd/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,10 @@ import (

// InitLogger initializes the root logger with the command line flags.
func InitLogger(c *cli.Context) {
var handler log.Handler
if c.Bool(flags.LogJson.Name) {
handler = log.LvlFilterHandler(
log.Lvl(c.Int(flags.Verbosity.Name)),
log.StreamHandler(os.Stdout, log.JSONFormat()),
)
} else {
handler = log.LvlFilterHandler(
log.Lvl(c.Int(flags.Verbosity.Name)),
log.StreamHandler(os.Stdout, log.TerminalFormat(true)),
)
}
var (
slogVerbosity = log.FromLegacyLevel(c.Int(flags.Verbosity.Name))
)

log.Root().SetHandler(handler)
glogger := log.NewGlogHandler(log.NewTerminalHandlerWithLevel(os.Stdout, slogVerbosity, true))
log.SetDefault(log.NewLogger(glogger))
}
16 changes: 0 additions & 16 deletions testutils/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/suite"
"github.com/taikoxyz/taiko-client/pkg/jwt"
"github.com/taikoxyz/taiko-client/pkg/rpc"
Expand All @@ -31,21 +30,6 @@ type ClientTestSuite struct {
}

func (s *ClientTestSuite) SetupTest() {
// Default logger
log.Root().SetHandler(
log.LvlFilterHandler(log.LvlInfo, log.StreamHandler(os.Stdout, log.TerminalFormat(true))),
)

if os.Getenv("LOG_LEVEL") != "" {
level, err := log.LvlFromString(os.Getenv("LOG_LEVEL"))
if err != nil {
log.Crit("Invalid log level", "level", os.Getenv("LOG_LEVEL"))
}
log.Root().SetHandler(
log.LvlFilterHandler(level, log.StreamHandler(os.Stdout, log.TerminalFormat(true))),
)
}

testAddrPrivKey, err := crypto.ToECDSA(
common.Hex2Bytes("ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"),
)
Expand Down

0 comments on commit d5a3990

Please sign in to comment.