From 80e2d8f975a827281c12737d63af7a00335ac499 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Sun, 19 May 2024 12:34:14 +0900 Subject: [PATCH] fixup --- connection.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/connection.go b/connection.go index 1e76df802..a3dc09d2c 100644 --- a/connection.go +++ b/connection.go @@ -50,16 +50,16 @@ type mysqlConn struct { // Helper function to call per-connection logger. func (mc *mysqlConn) log(v ...any) { _, filename, lineno, ok := runtime.Caller(1) - prefix := "" if ok { - pos = strings.LastIndexByte(filename, '/') + pos := strings.LastIndexByte(filename, '/') if pos != -1 { filename = filename[pos+1:] } - prefix = fmt.Sprintf("%s:%d: ", filename, lineno) + prefix := fmt.Sprintf("%s:%d ", filename, lineno) + v = append([]any{prefix}, v...) } - mc.cfg.Logger.Print(prefix, v...) + mc.cfg.Logger.Print(v...) } // Handles parameters set in DSN after the connection is established