From 395c16063a6dffdbbc8b7f3f1a91fd163a9006bb Mon Sep 17 00:00:00 2001 From: Dumindu Madunuwan Date: Sat, 21 Oct 2023 12:59:06 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=B1=20Sync=20with=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/logger/logger.go | 12 ------------ util/logger/logger_test.go | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/util/logger/logger.go b/util/logger/logger.go index 021c270..82d67cd 100644 --- a/util/logger/logger.go +++ b/util/logger/logger.go @@ -19,18 +19,6 @@ func New(isDebug bool) *Logger { logLevel = zerolog.TraceLevel } - zerolog.SetGlobalLevel(logLevel) - logger := zerolog.New(os.Stderr).With().Timestamp().Logger() - - return &Logger{logger: &logger} -} - -func NewConsole(isDebug bool) *Logger { - logLevel := zerolog.InfoLevel - if isDebug { - logLevel = zerolog.TraceLevel - } - zerolog.SetGlobalLevel(logLevel) logger := zerolog.New(os.Stdout).With().Timestamp().Logger() diff --git a/util/logger/logger_test.go b/util/logger/logger_test.go index 5de1d3b..76a5a6e 100644 --- a/util/logger/logger_test.go +++ b/util/logger/logger_test.go @@ -28,7 +28,7 @@ func setup() *logger.Logger { return time.Date(2008, 1, 8, 17, 5, 5, 0, time.UTC) } - return logger.NewConsole(true) + return logger.New(true) } // Simple logging example using the Print function in the log package