-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logger interface compatible with testing package #593
Comments
Probably the best way to implement this without breaking backwards compat is to change the Logger to an empty interface. Then use type inference to choose different loggers
|
Workaround
|
Although I cannot argue the convenience argument (mostly because it's subjective), I think what you labeled as "Workaround" is actually the solution. Interfaces are there to be defined by the consumer, not by other code we want it to be compatible with. Changing to an empty interface is a bad idea IMHO, defeats the whole purpose of interfaces. I would just leave things as they are. If that 6 extra LOC is really bothering you, I would just try to contribute it as an optional implementation. |
My pet peeve with the logger is that is Global on package level. So wouldn't |
Issue description
It would be convenient if the Logger interface was compatible with the testing logger (Logf).
Example code
Error log
Configuration
Driver version (or git SHA):
1.3.0
Go version: run
go version
in your console1.8.1
Server version: E.g. MySQL 5.6, MariaDB 10.0.20
MySQL 5.6
Server OS: E.g. Debian 8.1 (Jessie), Windows 10
Oracle Linux 7
The text was updated successfully, but these errors were encountered: