diff --git a/log.go b/log.go index 9000fc0..44772dd 100644 --- a/log.go +++ b/log.go @@ -185,12 +185,24 @@ func (l *logger) output(t tout, depth int, stack string, fields H, v ...interfac var err error switch t { case terror: + if LEVEL&Lerror == 0 { + return + } err = l.err_tmpl.Execute(l.err, data) case tdebug: + if LEVEL&Ldebug == 0 { + return + } err = l.debug_tmpl.Execute(l.err, data) case twarn: + if LEVEL&Lwarn == 0 { + return + } err = l.warn_tmpl.Execute(l.out, data) case tinfo: + if LEVEL&Linfo == 0 { + return + } err = l.info_tmpl.Execute(l.out, data) } if err != nil {