This is an automated email from the ASF dual-hosted git repository.
mxmrlv pushed a commit to branch
ARIA-416-Providing-handlers-to-logging_handlers-only-adds-handles-instead-of-replacing
in repository https://gitbox.apache.org/repos/asf/incubator-ariatosca.git
The following commit(s) were added to
refs/heads/ARIA-416-Providing-handlers-to-logging_handlers-only-adds-handles-instead-of-replacing
by this push:
new 18c9745 review 1
18c9745 is described below
commit 18c9745e77b3008ce012aec16d5fb0ad5bf93cc1
Author: max-orlov <[email protected]>
AuthorDate: Mon Dec 4 11:21:32 2017 +0200
review 1
---
aria/orchestrator/context/common.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/aria/orchestrator/context/common.py
b/aria/orchestrator/context/common.py
index 87444a9..9dfaad4 100644
--- a/aria/orchestrator/context/common.py
+++ b/aria/orchestrator/context/common.py
@@ -114,7 +114,7 @@ class BaseContext(object):
.format(name=self.__class__.__name__, self=self))
@contextmanager
- def logging_handlers(self, handlers=None):
+ def logging_handlers(self, handlers):
original_handlers = self.logger.handlers
handlers = handlers or []
try:
@@ -124,8 +124,7 @@ class BaseContext(object):
self.logger.removeHandler(handler)
yield self.logger
finally:
- for handler in handlers:
- self.logger.removeHandler(handler)
+ self.logger.handlers = []
for handler in original_handlers:
self.logger.addHandler(handler)
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].