MCPcopy
hub / github.com/go-sql-driver/mysql / log

Method log

connection.go:54–66  ·  view source on GitHub ↗

Helper function to call per-connection logger.

(v ...any)

Source from the content-addressed store, hash-verified

52
53// Helper function to call per-connection logger.
54func (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
68func (mc *mysqlConn) readWithTimeout(b []byte) (int, error) {
69 to := mc.cfg.ReadTimeout

Callers 6

readPacketMethod · 0.95
writePacketMethod · 0.95
authMethod · 0.95
cleanupMethod · 0.95
PrepareMethod · 0.95
ResetSessionMethod · 0.95

Calls 1

PrintMethod · 0.65

Tested by

no test coverage detected