Add NullHandler to avoid warnings about no handler

pull/17119/head
Richard Belleville 6 years ago
parent 3990ff1dcf
commit e57c10d9f0
  1. 1
      src/python/grpcio/grpc/_channel.py
  2. 1
      src/python/grpcio/grpc/_common.py
  3. 1
      src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi
  4. 1
      src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
  5. 1
      src/python/grpcio/grpc/_plugin_wrapping.py
  6. 1
      src/python/grpcio/grpc/framework/foundation/callable_util.py
  7. 1
      src/python/grpcio/grpc/framework/foundation/logging_pool.py
  8. 1
      src/python/grpcio/grpc/framework/foundation/stream_util.py
  9. 1
      src/python/grpcio_tests/tests/unit/_logging_test.py

@ -25,6 +25,7 @@ from grpc._cython import cygrpc
from grpc.framework.foundation import callable_util
_LOGGER = logging.getLogger(__name__)
_LOGGER.addHandler(logging.NullHandler)
_USER_AGENT = 'grpc-python/{}'.format(_grpcio_metadata.__version__)

@ -21,6 +21,7 @@ import grpc
from grpc._cython import cygrpc
_LOGGER = logging.getLogger(__name__)
_LOGGER.addHandler(logging.NullHandler())
CYGRPC_CONNECTIVITY_STATE_TO_CHANNEL_CONNECTIVITY = {
cygrpc.ConnectivityState.idle:

@ -15,6 +15,7 @@
import logging
_LOGGER = logging.getLogger(__name__)
_LOGGER.addHandler(logging.NullHandler())
# This function will ascii encode unicode string inputs if neccesary.
# In Python3, unicode strings are the default str type.

@ -19,6 +19,7 @@ import time
import grpc
_LOGGER = logging.getLogger(__name__)
_LOGGER.addHandler(logging.NullHandler())
cdef class Server:

@ -21,6 +21,7 @@ from grpc import _common
from grpc._cython import cygrpc
_LOGGER = logging.getLogger(__name__)
_LOGGER.addHandler(logging.NullHandler())
class _AuthMetadataContext(

@ -22,6 +22,7 @@ import logging
import six
_LOGGER = logging.getLogger(__name__)
_LOGGER.addHandler(logging.NullHandler())
class Outcome(six.with_metaclass(abc.ABCMeta)):

@ -18,6 +18,7 @@ import logging
from concurrent import futures
_LOGGER = logging.getLogger(__name__)
_LOGGER.addHandler(logging.NullHandler())
def _wrap(behavior):

@ -20,6 +20,7 @@ from grpc.framework.foundation import stream
_NO_VALUE = object()
_LOGGER = logging.getLogger(__name__)
_LOGGER.addHandler(NullHandler())
class TransformingConsumer(stream.Consumer):

@ -19,6 +19,7 @@ import grpc
import logging
class LoggingTest(unittest.TestCase):
def test_logger_not_occupied(self):
self.assertEqual(0, len(logging.getLogger().handlers))

Loading…
Cancel
Save