Skip to content

Commit

Permalink
Simplify redundant logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatthm committed Sep 20, 2024
1 parent 508cf0f commit 215b5f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ func (l *Logger) Error(ctx context.Context, msg string, keysAndValues ...any) {

func (l *Logger) get(ctx context.Context, level zapcore.Level) *zap.SugaredLogger {
z := l.sugared
if (l.levelEnabler != nil && !l.levelEnabler.Enabled(level)) || (l.levelEnabler == nil && !l.AtomicLevel.Enabled(level)) {
if !l.levelEnabler.Enabled(level) {
z = nil
}

Expand Down

0 comments on commit 215b5f6

Please sign in to comment.