Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
methane committed May 19, 2024
1 parent 961210b commit 80e2d8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 80e2d8f

Please sign in to comment.