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

commit 4cbf60ce3c2fba1f3849a9e9f133a0ca6bad1a34
Author: max-orlov <ma...@gigaspaces.com>
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 cb2b37c..1252b0e 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
"comm...@ariatosca.apache.org" <comm...@ariatosca.apache.org>.

Reply via email to