From f6c74f25f0bd6e8cd1341701f3bc135f46691fe7 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Thu, 25 May 2017 10:16:19 -0500 Subject: [PATCH] Set some logger names explicitly In the next patch we'll add documentation about what shade logs to what logging facilities. To make sure that those named facilities are maintained as part of the interface a consumer can count on, set non-root logger names explicitly. Also, this changes the logger name for the "waiting" messages from shade._utils to shade.iterate_timeout. _utils is an implemenation detail and such subject to change. The logger for it is not. Change-Id: I2ff413062c4cc3b49872fa8fd24e5daade063187 --- shade/_utils.py | 2 +- shade/exc.py | 2 +- shade/task_manager.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shade/_utils.py b/shade/_utils.py index 340b63c08..265ff5afc 100644 --- a/shade/_utils.py +++ b/shade/_utils.py @@ -48,7 +48,7 @@ def _iterate_timeout(timeout, message, wait=2): with . """ - log = _log.setup_logging(__name__) + log = _log.setup_logging('shade.iterate_timeout') try: # None as a wait winds up flowing well in the per-resource cache diff --git a/shade/exc.py b/shade/exc.py index f504e44de..eade31f54 100644 --- a/shade/exc.py +++ b/shade/exc.py @@ -37,7 +37,7 @@ class OpenStackCloudException(Exception): def log_error(self, logger=None): if not logger: - logger = _log.setup_logging(__name__) + logger = _log.setup_logging('shade.exc') if self.inner_exception and self.inner_exception[1]: logger.error(self.orig_message, exc_info=self.inner_exception) diff --git a/shade/task_manager.py b/shade/task_manager.py index d890b8a2c..9546653fb 100644 --- a/shade/task_manager.py +++ b/shade/task_manager.py @@ -226,7 +226,7 @@ def generate_task_class(method, name, result_filter_cb): class TaskManager(object): - log = _log.setup_logging(__name__) + log = _log.setup_logging('shade.task_manager') def __init__( self, client, name, result_filter_cb=None, workers=5, **kwargs):