Helper function to call per-connection logger.
(v ...any)
| 52 | |
| 53 | // Helper function to call per-connection logger. |
| 54 | func (mc *mysqlConn) log(v ...any) { |
| 55 | _, filename, lineno, ok := runtime.Caller(1) |
| 56 | if ok { |
| 57 | pos := strings.LastIndexByte(filename, '/') |
| 58 | if pos != -1 { |
| 59 | filename = filename[pos+1:] |
| 60 | } |
| 61 | prefix := fmt.Sprintf("%s:%d ", filename, lineno) |
| 62 | v = append([]any{prefix}, v...) |
| 63 | } |
| 64 | |
| 65 | mc.cfg.Logger.Print(v...) |
| 66 | } |
| 67 | |
| 68 | func (mc *mysqlConn) readWithTimeout(b []byte) (int, error) { |
| 69 | to := mc.cfg.ReadTimeout |
no test coverage detected