Only product stack trace if log level is debug
This commit is contained in:
parent
0e14256e0f
commit
1cb44cce2f
1 changed files with 3 additions and 1 deletions
4
db/db.go
4
db/db.go
|
@ -199,7 +199,9 @@ func (e *executor) execute(quit <-chan bool, send chan<- *Response) {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
if err, ok := r.(error); ok {
|
if err, ok := r.(error); ok {
|
||||||
log.WithPrefix("db").Errorln(err)
|
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())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
Loading…
Reference in a new issue