call done function when logger is disabled (#393)
This commit is contained in:
parent
c0c2e11fc3
commit
3efdd82416
3
log.go
3
log.go
|
@ -428,6 +428,9 @@ func (l Logger) Write(p []byte) (n int, err error) {
|
||||||
func (l *Logger) newEvent(level Level, done func(string)) *Event {
|
func (l *Logger) newEvent(level Level, done func(string)) *Event {
|
||||||
enabled := l.should(level)
|
enabled := l.should(level)
|
||||||
if !enabled {
|
if !enabled {
|
||||||
|
if done != nil {
|
||||||
|
done("")
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
e := newEvent(l.w, level)
|
e := newEvent(l.w, level)
|
||||||
|
|
Loading…
Reference in New Issue