Only product stack trace if log level is debug

This commit is contained in:
Tobie Morgan Hitchcock 2017-02-10 20:33:39 +00:00
parent 0e14256e0f
commit 1cb44cce2f

View file

@ -199,7 +199,9 @@ func (e *executor) execute(quit <-chan bool, send chan<- *Response) {
if r := recover(); r != nil {
if err, ok := r.(error); ok {
log.WithPrefix("db").Errorln(err)
log.WithPrefix("db").Debugln(string(debug.Stack()))
if log.Instance().Level >= log.DebugLevel {
log.WithPrefix("db").Debugf("%s", debug.Stack())
}
}
}
}()