fix: level

master
Evan Chen 2021-11-02 00:18:20 +08:00
parent bd9a99414c
commit 33ccd2714f
1 changed files with 12 additions and 0 deletions

12
log.go
View File

@ -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 {