-
Notifications
You must be signed in to change notification settings - Fork 574
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
Add StdLogger type #180
Comments
Can you please link the proposal? |
sure, golang/go#13182 |
I see no conclusion on this issue and no interface agreed on. |
yea, its still in proposal stage for Go 2, but you can see the direction for a standard interface. Right now you could infer a standard interface in Go v1.x by this assertion I'm good either way, as I've solved this in my code but I think it would be a nice addition to zerolog. Logrus is compatible with the above btw.. for ex, var _ StdLogger = &logrus.Logger{} // works |
We already have |
thanks @rs that would be a very nice help to clean up code in our microservices that use zerolog and integrate with community packages with the standard methods above |
Good idea! If |
You can currently redirect standard And issue #571 is about support for new structured logging interface in Golang. But there are still some methods found in stdlog missing in zerolog ( So sadly I do not see a way how this could be done in a backwards compatible way? |
Println has been added in #533. |
But |
When building community packages, developers use a variety of loggers. It's been proposed in Go 2 to have a common Logger interface, but the below will work quite well today.
As a suggestion, it would be nice to see this code added directly to the github.com/rs/zerolog package.
or perhaps as a method on the zerolog.Logger interface, returning a StdLogger() with the interface below.. I'm happy to add a PR for this too with either approach.
The text was updated successfully, but these errors were encountered: