You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ariatosca.apache.org by mx...@apache.org on 2017/11/28 15:31:30 UTC

[2/3] incubator-ariatosca git commit: handler configuration is more explicit

handler configuration is more explicit


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/4196a87e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/4196a87e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/4196a87e

Branch: refs/heads/generic_storage_update_serialization_logger_handler
Commit: 4196a87e1b74c95aff52f98ac91519ce53f8715f
Parents: b12bfd2
Author: max-orlov <ma...@gigaspaces.com>
Authored: Tue Nov 28 17:20:12 2017 +0200
Committer: max-orlov <ma...@gigaspaces.com>
Committed: Tue Nov 28 17:20:12 2017 +0200

----------------------------------------------------------------------
 aria/orchestrator/context/common.py | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4196a87e/aria/orchestrator/context/common.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/context/common.py b/aria/orchestrator/context/common.py
index 3c5f618..87444a9 100644
--- a/aria/orchestrator/context/common.py
+++ b/aria/orchestrator/context/common.py
@@ -115,14 +115,19 @@ class BaseContext(object):
 
     @contextmanager
     def logging_handlers(self, handlers=None):
+        original_handlers = self.logger.handlers
         handlers = handlers or []
         try:
             for handler in handlers:
                 self.logger.addHandler(handler)
+            for handler in original_handlers:
+                self.logger.removeHandler(handler)
             yield self.logger
         finally:
             for handler in handlers:
                 self.logger.removeHandler(handler)
+            for handler in original_handlers:
+                self.logger.addHandler(handler)
 
     @property
     def model(self):