Skip to content

Commit

Permalink
Zero Logger behaves like Nop logger. (rs#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitar authored and mAdkins committed Mar 2, 2024
1 parent 8478118 commit 31df015
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,9 @@ func (l *Logger) newEvent(level Level, done func(string)) *Event {

// should returns true if the log event should be logged.
func (l *Logger) should(lvl Level) bool {
if l.w == nil {
return false
}
if lvl < l.level || lvl < GlobalLevel() {
return false
}
Expand Down

0 comments on commit 31df015

Please sign in to comment.