Only add logging handlers if there currently aren't any
This corrects an odd problem where Horizon would stand up multiple client objects, which would cause duplicate/triplicate/dozens of repeated log lines in its log files, due to multiple identical handlers being added to the logging object Fixes Bug 1182678 Change-Id: I020b3999c9008b996286ccb74a7801c96c43e71c
This commit is contained in:
@@ -113,7 +113,7 @@ class HTTPClient(object):
|
|||||||
|
|
||||||
# logging setup
|
# logging setup
|
||||||
self.debug_log = debug
|
self.debug_log = debug
|
||||||
if self.debug_log:
|
if self.debug_log and not _logger.handlers:
|
||||||
ch = logging.StreamHandler()
|
ch = logging.StreamHandler()
|
||||||
_logger.setLevel(logging.DEBUG)
|
_logger.setLevel(logging.DEBUG)
|
||||||
_logger.addHandler(ch)
|
_logger.addHandler(ch)
|
||||||
|
Reference in New Issue
Block a user