From 64ad9115e2efcd3e06a1067253d8e139f69160ef Mon Sep 17 00:00:00 2001 From: Radmehr Soleimanian <131693036+hertzcodes@users.noreply.github.com> Date: Thu, 3 Apr 2025 01:27:01 +0330 Subject: [PATCH] Update logger.go --- logger/logger.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/logger/logger.go b/logger/logger.go index e13c3813..14a5693e 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -135,21 +135,21 @@ func (l *logger) LogMode(level LogLevel) Interface { // Info print info func (l *logger) Info(ctx context.Context, msg string, data ...interface{}) { - if l.LogLevel >= Info { + if l.LogLevel <= Info { l.Printf(l.infoStr+msg, append([]interface{}{utils.FileWithLineNum()}, data...)...) } } // Warn print warn messages func (l *logger) Warn(ctx context.Context, msg string, data ...interface{}) { - if l.LogLevel >= Warn { + if l.LogLevel <= Warn { l.Printf(l.warnStr+msg, append([]interface{}{utils.FileWithLineNum()}, data...)...) } } // Error print error messages func (l *logger) Error(ctx context.Context, msg string, data ...interface{}) { - if l.LogLevel >= Error { + if l.LogLevel <= Error { l.Printf(l.errStr+msg, append([]interface{}{utils.FileWithLineNum()}, data...)...) } } @@ -158,7 +158,7 @@ func (l *logger) Error(ctx context.Context, msg string, data ...interface{}) { // //nolint:cyclop func (l *logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error) { - if l.LogLevel <= Silent { + if l.LogLevel >= Silent { return }