From 5fc0547a94ce125e952a1782c4691e3902892ed4 Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Wed, 28 Nov 2018 11:05:09 -0800 Subject: [PATCH] Add basicConfig to prepare to log future exception --- examples/python/helloworld/greeter_client.py | 2 ++ examples/python/helloworld/greeter_client_with_options.py | 2 ++ examples/python/helloworld/greeter_server.py | 2 ++ examples/python/helloworld/greeter_server_with_reflection.py | 2 ++ examples/python/interceptors/default_value/greeter_client.py | 2 ++ examples/python/interceptors/headers/greeter_client.py | 2 ++ examples/python/interceptors/headers/greeter_server.py | 2 ++ examples/python/multiplex/multiplex_client.py | 2 ++ examples/python/multiplex/multiplex_server.py | 2 ++ examples/python/route_guide/route_guide_client.py | 2 ++ examples/python/route_guide/route_guide_server.py | 2 ++ 11 files changed, 22 insertions(+) diff --git a/examples/python/helloworld/greeter_client.py b/examples/python/helloworld/greeter_client.py index 24b49ac2336..ee2032a9e6e 100644 --- a/examples/python/helloworld/greeter_client.py +++ b/examples/python/helloworld/greeter_client.py @@ -14,6 +14,7 @@ """The Python implementation of the GRPC helloworld.Greeter client.""" from __future__ import print_function +import logging import grpc @@ -32,4 +33,5 @@ def run(): if __name__ == '__main__': + logging.basicConfig() run() diff --git a/examples/python/helloworld/greeter_client_with_options.py b/examples/python/helloworld/greeter_client_with_options.py index 7eda8c9066f..d15871b5195 100644 --- a/examples/python/helloworld/greeter_client_with_options.py +++ b/examples/python/helloworld/greeter_client_with_options.py @@ -14,6 +14,7 @@ """The Python implementation of the GRPC helloworld.Greeter client with channel options and call timeout parameters.""" from __future__ import print_function +import logging import grpc @@ -41,4 +42,5 @@ def run(): if __name__ == '__main__': + logging.basicConfig() run() diff --git a/examples/python/helloworld/greeter_server.py b/examples/python/helloworld/greeter_server.py index c355662ef86..e3b4f2c1ff9 100644 --- a/examples/python/helloworld/greeter_server.py +++ b/examples/python/helloworld/greeter_server.py @@ -15,6 +15,7 @@ from concurrent import futures import time +import logging import grpc @@ -43,4 +44,5 @@ def serve(): if __name__ == '__main__': + logging.basicConfig() serve() diff --git a/examples/python/helloworld/greeter_server_with_reflection.py b/examples/python/helloworld/greeter_server_with_reflection.py index 5ba8782dfca..5acedbcb71f 100644 --- a/examples/python/helloworld/greeter_server_with_reflection.py +++ b/examples/python/helloworld/greeter_server_with_reflection.py @@ -15,6 +15,7 @@ from concurrent import futures import time +import logging import grpc from grpc_reflection.v1alpha import reflection @@ -49,4 +50,5 @@ def serve(): if __name__ == '__main__': + logging.basicConfig() serve() diff --git a/examples/python/interceptors/default_value/greeter_client.py b/examples/python/interceptors/default_value/greeter_client.py index da21ac68ec5..25834c2bbdd 100644 --- a/examples/python/interceptors/default_value/greeter_client.py +++ b/examples/python/interceptors/default_value/greeter_client.py @@ -14,6 +14,7 @@ """The Python implementation of the gRPC helloworld.Greeter client.""" from __future__ import print_function +import logging import grpc @@ -39,4 +40,5 @@ def run(): if __name__ == '__main__': + logging.basicConfig() run() diff --git a/examples/python/interceptors/headers/greeter_client.py b/examples/python/interceptors/headers/greeter_client.py index 6a09a3b9c50..712539850d3 100644 --- a/examples/python/interceptors/headers/greeter_client.py +++ b/examples/python/interceptors/headers/greeter_client.py @@ -14,6 +14,7 @@ """The Python implementation of the GRPC helloworld.Greeter client.""" from __future__ import print_function +import logging import grpc @@ -37,4 +38,5 @@ def run(): if __name__ == '__main__': + logging.basicConfig() run() diff --git a/examples/python/interceptors/headers/greeter_server.py b/examples/python/interceptors/headers/greeter_server.py index 01968609b53..6b0f4058bcd 100644 --- a/examples/python/interceptors/headers/greeter_server.py +++ b/examples/python/interceptors/headers/greeter_server.py @@ -15,6 +15,7 @@ from concurrent import futures import time +import logging import grpc @@ -49,4 +50,5 @@ def serve(): if __name__ == '__main__': + logging.basicConfig() serve() diff --git a/examples/python/multiplex/multiplex_client.py b/examples/python/multiplex/multiplex_client.py index 19d39ce66eb..155f85c4b0c 100644 --- a/examples/python/multiplex/multiplex_client.py +++ b/examples/python/multiplex/multiplex_client.py @@ -17,6 +17,7 @@ from __future__ import print_function import random import time +import logging import grpc @@ -126,4 +127,5 @@ def run(): if __name__ == '__main__': + logging.basicConfig() run() diff --git a/examples/python/multiplex/multiplex_server.py b/examples/python/multiplex/multiplex_server.py index 70dec3c9390..c01824b3a97 100644 --- a/examples/python/multiplex/multiplex_server.py +++ b/examples/python/multiplex/multiplex_server.py @@ -16,6 +16,7 @@ from concurrent import futures import time import math +import logging import grpc @@ -136,4 +137,5 @@ def serve(): if __name__ == '__main__': + logging.basicConfig() serve() diff --git a/examples/python/route_guide/route_guide_client.py b/examples/python/route_guide/route_guide_client.py index b4ff3239ba8..dc93fb44379 100644 --- a/examples/python/route_guide/route_guide_client.py +++ b/examples/python/route_guide/route_guide_client.py @@ -16,6 +16,7 @@ from __future__ import print_function import random +import logging import grpc @@ -116,4 +117,5 @@ def run(): if __name__ == '__main__': + logging.basicConfig() run() diff --git a/examples/python/route_guide/route_guide_server.py b/examples/python/route_guide/route_guide_server.py index 1969fdd378d..e00cb699084 100644 --- a/examples/python/route_guide/route_guide_server.py +++ b/examples/python/route_guide/route_guide_server.py @@ -16,6 +16,7 @@ from concurrent import futures import time import math +import logging import grpc @@ -126,4 +127,5 @@ def serve(): if __name__ == '__main__': + logging.basicConfig() serve()