-
Notifications
You must be signed in to change notification settings - Fork 67
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
feat(logger): implement slog.Handler #13
Conversation
Welcome to Codecov 🎉Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment. Thanks for integrating Codecov - We've got you covered ☂️ |
4b37215
to
ffbea2a
Compare
0a54f15
to
6391d1a
Compare
👋 Was looking for bridging with |
@owenthereal I believe we're just waiting for slog to be merged into the language as the API may change in the meantime. golang/go#56345 (I think that's the right issue iirc) Will be quick to merge once that's all up to date! |
Now that 1.21 released |
Is there anything I can do to help get #74 merged in with this / with this PR released? |
Hi @jamietanna, Thanks for working on #74. It would be awesome to make it use |
Ooh interesting! Sure thing, I was thinking of only supporting as early as Go 1.20, as it's the earliest version of Go that the Go team support, but happy to add |
This implements slog.Handler interface. You can use Log as an slog handler.
Thanks for carrying on with this I'd remembered yesterday I needed to get back to my PR, but appreciate you doing it 🙌🏽 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
It looks like it might be a breaking change though, as the JSON keys for some fields changed.
Yes, that's correct, there will be breaking changes in the next release |
Uses x/exp/slog for go1.19 and go1.20 and log/slog for >go1.21.
Upgrades the minimum go version to go1.19
Example:
Output:
Fixes: #8