-
Notifications
You must be signed in to change notification settings - Fork 10.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
python: grpcio==1.16.0 adds a new logging handler for stderr #17135
Comments
This issue was resolved by #17064. A patch to 1.16 containing this fix is forthcoming. |
@attila123, 1.16.1rc1 with this fix is released. If no issues reported, expect the final release in about a week. |
@srini100 Thanks. I'm a bit busy (and lazy) to build it from source myself, so I will wait until a new version is published to pypi. |
@attila123, 1.16.1rc1 is published to pypi. You can just do |
@srini100 Thanks, maybe I overlooked something. Just tested with grpcio==1.16.1rc1, I can confirm that this issue is solved in that version. |
What version of gRPC and what language are you using?
grpcio==1.16.0, python
What operating system (Linux, Windows, …) and version?
Arch Linux (recent)
What runtime / compiler are you using (e.g. python version or version of gcc)
python 3.7.1
I installed grpcio via pip from pypi.
What did you do?
I ran my application as usual. After updating to grpcio==1.16.0 from grpcio==1.15.0 I see that my log lines were also output to stderr. I double checked it and it does not happen with 1.15.0.
My application currently uses the root logger (maybe not the best practice), creates a handler and uses
logging.root.addHandler() to add it to the root logger.
What did you expect to see?
That logging behaviour is not changed by updating grpcio.
Or at least it should have been documented (did not find anything about it in the changelog).
Please let me know how I can disable this gprcio adding this extra handler.
I thought I could iterate over the handlers of the root logger, trying to find this extra handler and remove it, but it would be an ugly workaround.
What did you see instead?
With pycharm I put a breakpoint in
/usr/lib/python3.7/logging/__init__.py
addHandler() (line 1535), and I can confirm that with grpcio==1.16.0 this addHandler() method is called from the grpcio library (see the attached screenshot). (Again, this does not happen with 1.15.0, I checked it.)In the call stack it is also (somewhat) visible that it is triggered from
grpc/__init__.py
line 22 which does the following:from grpc._cython import cygrpc as _cygrpc
and this is triggered when my application doesimport grpc
.Anything else we should know about your project / environment?
The text was updated successfully, but these errors were encountered: