Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
swift1337 committed Jul 11, 2024
1 parent 23ef837 commit c94d844
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions zetaclient/chains/base/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,22 @@ func InitLogger(cfg config.Config) (Logger, error) {
return DefaultLogger(), err
}

level := zerolog.Level(cfg.LogLevel)

// create loggers based on configured level and format
var std zerolog.Logger
var compliance zerolog.Logger
switch cfg.LogFormat {
case "json":
std = zerolog.New(os.Stdout).Level(zerolog.Level(cfg.LogLevel)).With().Timestamp().Logger()
compliance = zerolog.New(file).Level(zerolog.Level(cfg.LogLevel)).With().Timestamp().Logger()
std = zerolog.New(os.Stdout).Level(level).With().Timestamp().Logger()
compliance = zerolog.New(file).Level(level).With().Timestamp().Logger()
case "text":
std = zerolog.New(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339}).
Level(zerolog.Level(cfg.LogLevel)).
With().
Timestamp().
Logger()
compliance = zerolog.New(file).Level(zerolog.Level(cfg.LogLevel)).With().Timestamp().Logger()
compliance = zerolog.New(file).Level(level).With().Timestamp().Logger()
default:
std = zerolog.New(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339})
compliance = zerolog.New(file).With().Timestamp().Logger()
Expand Down

0 comments on commit c94d844

Please sign in to comment.