diff --git a/docs/logging-usage.rst b/docs/logging-usage.rst index f2c9bf7106b8..5c55310fe927 100644 --- a/docs/logging-usage.rst +++ b/docs/logging-usage.rst @@ -406,7 +406,7 @@ To automatically pick the default for your current environment, use >>> client = google.cloud.logging.Client() >>> handler = client.get_default_handler() >>> cloud_logger = logging.getLogger('cloudLogger') - >>> cloud_logger.setLevel(logging.INFO) # defaults to WARN + >>> cloud_logger.setLevel(logging.INFO) >>> cloud_logger.addHandler(handler) >>> cloud_logger.error('bad news') @@ -452,7 +452,7 @@ instance which will write directly to the API. >>> client = google.cloud.logging.Client() >>> handler = CloudLoggingHandler(client) >>> cloud_logger = logging.getLogger('cloudLogger') - >>> cloud_logger.setLevel(logging.INFO) # defaults to WARN + >>> cloud_logger.setLevel(logging.INFO) >>> cloud_logger.addHandler(handler) >>> cloud_logger.error('bad news') diff --git a/logging/unit_tests/test_client.py b/logging/unit_tests/test_client.py index 8ef4f160f42a..2fbd29d7fc71 100644 --- a/logging/unit_tests/test_client.py +++ b/logging/unit_tests/test_client.py @@ -582,7 +582,7 @@ def test_get_default_handler_app_engine(self): credentials=_Credentials(), use_gax=False) - os.environ[_APPENGINE_FLEXIBLE_ENV_VM] = True + os.environ[_APPENGINE_FLEXIBLE_ENV_VM] = "True" with _Monkey(_MUT, _LOG_PATH_TEMPLATE='{pid}'): handler = client.get_default_handler() self.assertIsInstance(handler, AppEngineHandler) @@ -596,7 +596,7 @@ def test_get_default_handler_container_engine(self): client = self._makeOne(project=self.PROJECT, credentials=_Credentials(), use_gax=False) - os.environ[_CONTAINER_ENGINE_ENV] = True + os.environ[_CONTAINER_ENGINE_ENV] = "True" handler = client.get_default_handler() self.assertIsInstance(handler, ContainerEngineHandler) del os.environ[_CONTAINER_ENGINE_ENV]