From c4046fe2cb464d5dbf29db013c75025686af8596 Mon Sep 17 00:00:00 2001 From: Mitar Date: Fri, 20 Oct 2023 19:20:52 -0700 Subject: [PATCH] Zero Logger behaves like Nop logger. (#606) --- log.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/log.go b/log.go index c1866511..804093f8 100644 --- a/log.go +++ b/log.go @@ -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 }