From 1cb44cce2f965e85e15024229c31d08a8b7e19d0 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Fri, 10 Feb 2017 20:33:39 +0000 Subject: [PATCH] Only product stack trace if log level is debug --- db/db.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/db.go b/db/db.go index aff59ffc..9840d15f 100644 --- a/db/db.go +++ b/db/db.go @@ -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()) + } } } }()