-
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
Make zaptest.NewTestingWriter public #1399
Conversation
As an alternative to making newTestingWriter public would it help to configure zaptest.NewLogger?
|
@r-hang , thanks for your review. In the
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1399 +/- ##
==========================================
+ Coverage 98.28% 98.42% +0.14%
==========================================
Files 53 53
Lines 3495 3495
==========================================
+ Hits 3435 3440 +5
+ Misses 50 46 -4
+ Partials 10 9 -1 ☔ View full report in Codecov by Sentry. |
@dimmo I think I understand. Just to confirm my understanding you could replace the core or constructor a new logger today if you duplicated and hand wrote an implementation for the testingWriter but since we already have one you want to reuse that one. I ran CI and see a go lint failure. It should be green after updating the exported comment. |
Exactly! Right now I temporarily copied implementation of
Thank you. |
Add more flexibility in configuring zap logger for tests.
The default
zapcore.Core
, which is created inzaptest.NewLogger()
may not be suitable for all use-cases.E.g., we may need custom encoder or encoder config.
This PR allows us to do such customization: