Add error stack to error log

This commit is contained in:
Tobie Morgan Hitchcock 2019-11-29 10:50:13 +00:00
parent 24c11f97f6
commit d0e1fd90fd

View file

@ -51,6 +51,7 @@ func newExecutor(id, ns, db string) (e *executor) {
e.db = db e.db = db
e.err = nil e.err = nil
e.buf = nil
e.data = sync.Map{} e.data = sync.Map{}
@ -203,6 +204,7 @@ func (e *executor) conduct(ctx context.Context, stm sql.Statement) {
logKeyVars: ctx.Value(ctxKeyVars), logKeyVars: ctx.Value(ctxKeyVars),
logKeyTime: time.Since(e.time).String(), logKeyTime: time.Since(e.time).String(),
logKeyError: detail(e.err), logKeyError: detail(e.err),
logKeyStack: string(debug.Stack()),
}).Errorln(stm) }).Errorln(stm)
} }
} }