Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Feature] Add experiment
zapslog
package to integrate with slog #1246[Feature] Add experiment
zapslog
package to integrate with slog #1246Changes from 6 commits
27add2e
33a5847
b7216e5
a71b85e
45ff71e
289dc6b
d5dc1ff
dbb510d
24573ce
1ae5945
24e7bb4
a48a6b0
ba56da7
656ca5e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
cc @abhinav . Do we need to complete the
Entry
?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.
Those three fields are optional. We can start without them.
I can see Caller and LoggerName being filled in the future.
(We could probably fill the Caller from Record.PC,
but doing that cheaply adds some complexity so we can do without for now.)
However, this does bring up the need for customization.
A plain
NewHandler
may not be sufficient for that.I've pushed a change to your branch with the following new API:
The
func NewHandler(..)
just calls this now to get default options.This mirrors the JSONHandler, NewJSONHandler, HandlerOptions setup.
This leaves us room for future customization llke:
opting into adding a caller name, custom level mapping, etc.
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.
Thank you! The
HandlerOptions
is commonly used for customization, though I thought we might want to consistently follow the functional options pattern in zap.After some trial & error, I found I could add the Caller in this PR as well, plz see the commit 1ae5945