You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a feature proposal.
This library can only use global logger on package level, so different loggers cannot be used separately for each database or test.
It would be useful to be able to configure a logger per connection.
If ErrLog is nil, it fallbacks to the package global logger (errLog).
I'm not sure if adding it to the Config is a good idea since the ErrLog cannot be included into a DSN string.
Alternatively, I think there is a way to add parameters for configuration to NewConnector.
Issue description
This is a feature proposal.
This library can only use global logger on package level, so different loggers cannot be used separately for each database or test.
It would be useful to be able to configure a logger per connection.
Related: #593 (comment)
Example code
For example, add a field to Config like this:
If
ErrLog
is nil, it fallbacks to the package global logger (errLog
).I'm not sure if adding it to theConfig
is a good idea since theErrLog
cannot be included into a DSN string.Alternatively, I think there is a way to add parameters for configuration to NewConnector.
It would be nice to add a function like the following to support
ErrLog
in a DSN string.The text was updated successfully, but these errors were encountered: