-
Notifications
You must be signed in to change notification settings - Fork 81
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
Create slogr
implementation for slog
package
#171
Comments
Do we need a separate repo for it? Pro: versioning separately from go-logr/logr I think the versioning aspect is significant enough that it should be a separate repo. @Dentrax: do you want to work on such a slogr LogSink? |
I'm not so sure, just noticed there are a bunch of logger implementations separated along different repos: https://github.com/go-logr/logr#implementations-non-exhaustive
Not making promises, but maybe I can work on this. But don't know where to start. Is there any documentation for this? |
So this is basically a feature request to create an slogr. That's fine and definitely something that someone should do, but let's wait with creating the repo until there is something that we can put there. The other loggers could serve as example. There's no dedicated documentation for "how to write a LogSink". |
Such an slogr implementation is probably going to be more complicated. We also need to consider how libraries using logr will interact with binaries using slog. For example, consider an binary which creates a slog logger using some kind of implementation, then installs it as global slog logger and/or adds it to a context. Now a library calls Likewise with This implies that slogr has to be clue code in go-logr, and that go-logr itself needs to be built differently depending on the Go version, once slog becomes part of some release. |
https://github.com/pohly/zapr/tree/slog has some preliminary slogr implementation. I think the code should be in logr because then |
We now have slog support (unreleased, but should be in next tag). We'll evolve it more but I will close this issue now. |
I'd be great to create a new separate repo called
slogr
forslog
logger. Any thoughts on this?Footnotes
https://www.youtube.com/watch?v=gd_Vyb5vEw0 ↩
The text was updated successfully, but these errors were encountered: