Skip to content
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

Make logger require an interface instead of a concrete implementation #732

Merged

Conversation

mcuelenaere
Copy link
Contributor

It is much easier to integrate 3rd-party log implementations by requiring an interface instead of requiring a Logger struct (which implements this interface).

Copy link
Collaborator

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix lint errors, rest lgtm

And is the Contextual from https://github.com/siddontang/go-log/blob/master/loggers/loggers.go better suit your use case? Seems it's more flexible.

@mcuelenaere
Copy link
Contributor Author

And is the Contextual from https://github.com/siddontang/go-log/blob/master/loggers/loggers.go better suit your use case? Seems it's more flexible.

It is more flexible, but AFAIK it is not implemented by the logger, so it would break things: https://github.com/siddontang/go-log/blob/master/log/logger.go#L63

It is much easier to integrate 3rd-party log implementations by requiring
an interface instead of requiring a Logger struct (which implements this
interface).
@mcuelenaere
Copy link
Contributor Author

please fix lint errors, rest lgtm

Should be fixed now.

@lance6716 lance6716 merged commit a3037c5 into go-mysql-org:master Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants