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 }