DebugWithContext gets a driver and a logging function, and returns a new debugged-driver that prints all outgoing operations with context.
(d dialect.Driver, logger func(context.Context, ...any))
| 22 | // DebugWithContext gets a driver and a logging function, and returns |
| 23 | // a new debugged-driver that prints all outgoing operations with context. |
| 24 | func DebugWithContext(d dialect.Driver, logger func(context.Context, ...any)) dialect.Driver { |
| 25 | drv := &DebugDriver{d, logger} |
| 26 | return drv |
| 27 | } |
| 28 | |
| 29 | // Exec logs its params and calls the underlying driver Exec method. |
| 30 | func (d *DebugDriver) Exec(ctx context.Context, query string, args, v any) error { |