Hi,
As query logging is being run deferred;
deferfunc(start time.Time) {
queryLog(&QueryStatus{
TxID: sess.txID,
SessID: sess.sessID,
Query: query,
Err: err,
Start: start,
End: time.Now(),
Context: ctx,
})
}(time.Now())We lost caller file:line location. Because of this, current logger always prints location as ...sqladapter/session.go:647 which is meaningless.
func (c*loggingCollector) logf(levelLogLevel, fstring, v...interface{}) {
format:=level.String() +"\n"+fif_, file, line, ok:=runtime.Caller(2); ok {
format=fmt.Sprintf("log_level=%s file=%s:%d\n%s", level, file, line, f)
}
format="upper/db: "+format...I think we should respect logging as first-class.
Hi,
As query logging is being run deferred;
We lost caller file:line location. Because of this, current logger always prints location as
...sqladapter/session.go:647which is meaningless.I think we should respect logging as first-class.