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 }