aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio/grpc/_cython
diff options
context:
space:
mode:
authorGravatar Naresh <ghostwriternr@gmail.com>2018-08-17 12:24:58 +0000
committerGravatar Naresh <ghostwriternr@gmail.com>2018-08-17 12:24:58 +0000
commita20e2073c1c53cbdd81a4fb750982a0b13e0c24e (patch)
treed7501b2580665a426caae2e29e05beb179cc711d /src/python/grpcio/grpc/_cython
parent0a1d0d25a2392a0fa70d8ad54c572bdc726b62d3 (diff)
Configure module level loggers with basicConfig()
Module level loggers were introduced to gRPC Python in 06e1683, but missed configuring these, leading to 'No handler found for module' errors. Using the root logger implicitly calls basicConfig() which does the basic configuration for the logging system by creating a StreamHandler with a default Formatter and adding it to the logger. But this is not the case for module level loggers. Fix this issue by explicitly calling logging.basicConfig().
Diffstat (limited to 'src/python/grpcio/grpc/_cython')
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi1
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi
index 00a1b23a67..334e561baa 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi
@@ -14,6 +14,7 @@
import logging
+logging.basicConfig()
_LOGGER = logging.getLogger(__name__)
# This function will ascii encode unicode string inputs if neccesary.
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
index da3dd21244..8cece46437 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
@@ -18,6 +18,7 @@ import logging
import time
import grpc
+logging.basicConfig()
_LOGGER = logging.getLogger(__name__)
cdef grpc_ssl_certificate_config_reload_status _server_cert_config_fetcher_wrapper(