[
https://issues.apache.org/jira/browse/ARIA-416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16276504#comment-16276504
]
ASF GitHub Bot commented on ARIA-416:
-------------------------------------
Github user aviyoop commented on a diff in the pull request:
https://github.com/apache/incubator-ariatosca/pull/210#discussion_r154592494
--- Diff: aria/orchestrator/context/common.py ---
@@ -115,14 +115,19 @@ def __repr__(self):
@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:
--- End diff --
To prevent the original handlers from being duplicated, you should first
(in the `finally` block) empty the logger from handlers, and then add the
original handlers.
> Providing handlers to logging_handlers only adds handles instead of replacing
> ------------------------------------------------------------------------------
>
> Key: ARIA-416
> URL: https://issues.apache.org/jira/browse/ARIA-416
> Project: AriaTosca
> Issue Type: Bug
> Affects Versions: 0.2.0
> Reporter: Maxim Orlov
> Assignee: Maxim Orlov
> Priority: Minor
>
> providing handlers to logging handlers only adds handles instead of replacing
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)