Skip to content

Commit 80e2d8f

Browse files
committed
fixup
1 parent 961210b commit 80e2d8f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

connection.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ type mysqlConn struct {
5050
// Helper function to call per-connection logger.
5151
func (mc *mysqlConn) log(v ...any) {
5252
_, filename, lineno, ok := runtime.Caller(1)
53-
prefix := ""
5453
if ok {
55-
pos = strings.LastIndexByte(filename, '/')
54+
pos := strings.LastIndexByte(filename, '/')
5655
if pos != -1 {
5756
filename = filename[pos+1:]
5857
}
59-
prefix = fmt.Sprintf("%s:%d: ", filename, lineno)
58+
prefix := fmt.Sprintf("%s:%d ", filename, lineno)
59+
v = append([]any{prefix}, v...)
6060
}
6161

62-
mc.cfg.Logger.Print(prefix, v...)
62+
mc.cfg.Logger.Print(v...)
6363
}
6464

6565
// Handles parameters set in DSN after the connection is established

0 commit comments

Comments
 (0)