-
Notifications
You must be signed in to change notification settings - Fork 691
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
gRPC Zap ReplaceGrpcLoggerV2 #221
gRPC Zap ReplaceGrpcLoggerV2 #221
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
Codecov Report
@@ Coverage Diff @@
## master #221 +/- ##
==========================================
- Coverage 73.28% 71.55% -1.74%
==========================================
Files 37 37
Lines 1359 1392 +33
==========================================
Hits 996 996
- Misses 314 347 +33
Partials 49 49
Continue to review full report at Codecov.
|
Other path would be instead of introducing ReplaceGrpcLoggerV2, just change ReplaceGrpcLogger internals. The interface to the user doesn't change (input is still only a zap.Logger). |
I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
bcff978
to
9890c6a
Compare
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.
Thanks for this @kush-patel-hs and thanks for poking us to keep up the momentum. 👍 Appreciate new contributions.
Looks good for me just a nit ... merge once @devnev is happy (will poke ;) )
Thanks @domgreen! Pretty excited to get this in, will help us clear up some noisy logs from using the v1 logger implementation at Hootsuite |
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.
Speaking with @devnev offline we can make this match much closer with the upstream code https://github.com/grpc/grpc-go/blob/master/grpclog/loggerv2.go and remove some of the complexity around options :)
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.
Thanks for the changes 👍
Thanks for all the help 👍 |
@kush-patel-hs Hi! I tried this. My default |
@fproulx-eoscanada verbosity |
@kush-patel-hs ah! great so let's set it back to |
Awesome :) let me know if you need any more help! |
Who can add logrus log with ReplaceGrpcLoggerV2? |
In case others run across this thread, you might want or need to pass a sublogger with a different level then your root logger. This can look something like:
And it appears that "increase" means more restrictive, with less log lines getting through, not "increase" as in increasing the volume of the lines being emitted. |
We at Hootsuite were noticing noisy logs coming from grpc and we noticed it's because grpc_zap implements logger v1 interface. We need the logger v2 implemented instead, so I have opened this PR.
This is a revived and comments addressed version of #144 which was opened by @jamisonhyatt. Feel free to just merge this in after approval if it looks good!