From c94d844a2aa61e3c4c2f52e59871376c7ee09ac9 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 11 Jul 2024 15:48:21 +0200 Subject: [PATCH] Minor fix --- zetaclient/chains/base/logger.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zetaclient/chains/base/logger.go b/zetaclient/chains/base/logger.go index eeffcfab3b..94579df5ae 100644 --- a/zetaclient/chains/base/logger.go +++ b/zetaclient/chains/base/logger.go @@ -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()