-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Extend WithLazy
method to SugaredLogger
#1377
Comments
Hey @defval, this feature makes sense to me. Feel free to send us something for review! |
@r-hang Hey, mate! The PR is ready. Could you take a look at it soon? |
@r-hang, sorry for the ping, but can you take a look at the implementation? |
r-hang
pushed a commit
that referenced
this issue
Nov 25, 2023
Hey there! Resolves #1377 Notes: - I reused all tests from the `With()` method to work with both `With()` and `WithLazy()` - To highlight the differences between `With()` and `WithLazy()`, I added a test similar to [this one](https://github.com/uber-go/zap/pull/1319/files#diff-55a2db70576eb079880167200221ea3787a01fa4bbc958503769eba24084d842R179). I kept only the test cases that clearly show the distinctions Looking forward to your thoughts!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
zap
maintainers!Is your feature request related to a problem? Please describe.
The recently added
WithLazy
method is amazing (PR: #1319). This capability is not yet available forSugaredLogger
Describe the solution you'd like
The straightforward idea is to expose a similar signature from
SugaredLogger
usingWithLazy
method :There is still overhead from the
sweetenFields
call, but it's nonetheless much less than usingWith()
.Is this a breaking change?
Nope
If you approve, I'm ready to work on that because it's somewhat blocking us
The text was updated successfully, but these errors were encountered: