Skip to content

Commit

Permalink
fix log level unmarshalling
Browse files Browse the repository at this point in the history
  • Loading branch information
brewmaster012 committed Aug 19, 2023
1 parent e7a7f83 commit ed57b12
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/zetaclientd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func Initialize(_ *cobra.Command, _ []string) error {
configData.ZetaCoreURL = initArgs.zetacoreURL
configData.AuthzHotkey = initArgs.authzHotkey
configData.AuthzGranter = initArgs.authzGranter
configData.LogLevel = zerolog.Level(initArgs.level)
configData.LogLevel = initArgs.level
configData.LogFormat = initArgs.logFormat
configData.LogSampler = initArgs.logSampler
configData.P2PDiagnostic = initArgs.p2pDiagnostic
Expand Down
4 changes: 2 additions & 2 deletions cmd/zetaclientd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ func InitLogger(cfg *config.Config) zerolog.Logger {
var logger zerolog.Logger
switch cfg.LogFormat {
case "json":
logger = zerolog.New(os.Stdout).Level(cfg.LogLevel).With().Timestamp().Logger()
logger = zerolog.New(os.Stdout).Level(zerolog.Level(cfg.LogLevel)).With().Timestamp().Logger()
case "text":
logger = zerolog.New(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339}).Level(cfg.LogLevel).With().Timestamp().Logger()
logger = zerolog.New(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339}).Level(zerolog.Level(cfg.LogLevel)).With().Timestamp().Logger()
default:
logger = zerolog.New(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339})
}
Expand Down
3 changes: 1 addition & 2 deletions zetaclient/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/json"

"github.com/ethereum/go-ethereum/ethclient"
"github.com/rs/zerolog"
"github.com/zeta-chain/zetacore/common"
zetaObserverTypes "github.com/zeta-chain/zetacore/x/observer/types"
)
Expand Down Expand Up @@ -66,7 +65,7 @@ type Config struct {
Peer string
PublicIP string
LogFormat string
LogLevel zerolog.Level
LogLevel int8 // zerolog level
LogSampler bool
PreParamsPath string
Keygen zetaObserverTypes.Keygen
Expand Down

0 comments on commit ed57b12

Please sign in to comment.