You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by ra...@apache.org on 2017/04/04 10:22:07 UTC
[13/24] incubator-ariatosca git commit: before adding any handlers,
we check that theere are no handlers at the moment.
before adding any handlers, we check that theere are no handlers at the moment.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/2214a982
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/2214a982
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/2214a982
Branch: refs/heads/ARIA-48-aria-cli
Commit: 2214a982ee0fabd9e4eac72e6bcf7fe2169a67b9
Parents: 298885f
Author: max-orlov <ma...@gigaspaces.com>
Authored: Sun Apr 2 18:29:43 2017 +0300
Committer: Ran Ziv <ra...@gigaspaces.com>
Committed: Tue Apr 4 13:20:46 2017 +0300
----------------------------------------------------------------------
aria/orchestrator/context/common.py | 13 ++++++-------
aria/orchestrator/context/workflow.py | 1 -
2 files changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2214a982/aria/orchestrator/context/common.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/context/common.py b/aria/orchestrator/context/common.py
index f631e79..2e33d77 100644
--- a/aria/orchestrator/context/common.py
+++ b/aria/orchestrator/context/common.py
@@ -19,7 +19,6 @@ A common context for both workflow and operation
import logging
from contextlib import contextmanager
-from datetime import datetime
from functools import partial
import jinja2
@@ -68,13 +67,13 @@ class BaseContext(object):
self._workdir = workdir
self.logger = None
- def _register_logger(self, logger_name=None, level=None, task_id=None):
- self.logger = self.PrefixedLogger(logging.getLogger(logger_name or self.__class__.__name__),
- self.logging_id,
- task_id=task_id)
- self.logger.addHandler(aria_logger.create_console_log_handler())
- self.logger.addHandler(self._get_sqla_handler())
+ def _register_logger(self, level=None, task_id=None):
+ self.logger = self.PrefixedLogger(
+ logging.getLogger('aria.executions.task'), self.logging_id, task_id=task_id)
self.logger.setLevel(level or logging.DEBUG)
+ if not self.logger.handlers:
+ self.logger.addHandler(aria_logger.create_console_log_handler())
+ self.logger.addHandler(self._get_sqla_handler())
def _get_sqla_handler(self):
api_kwargs = {}
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2214a982/aria/orchestrator/context/workflow.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/context/workflow.py b/aria/orchestrator/context/workflow.py
index bc9f653..ad4a2ff 100644
--- a/aria/orchestrator/context/workflow.py
+++ b/aria/orchestrator/context/workflow.py
@@ -19,7 +19,6 @@ Workflow and operation contexts
import threading
from contextlib import contextmanager
-from datetime import datetime
from .exceptions import ContextException
from .common import BaseContext