Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A3842200C77 for ; Mon, 10 Apr 2017 11:51:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A23ED160B85; Mon, 10 Apr 2017 09:51:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0015D160B99 for ; Mon, 10 Apr 2017 11:51:17 +0200 (CEST) Received: (qmail 82029 invoked by uid 500); 10 Apr 2017 09:51:17 -0000 Mailing-List: contact dev-help@ariatosca.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ariatosca.incubator.apache.org Delivered-To: mailing list dev@ariatosca.incubator.apache.org Received: (qmail 81965 invoked by uid 99); 10 Apr 2017 09:51:17 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Apr 2017 09:51:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 9B98BC0FEE for ; Mon, 10 Apr 2017 09:51:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.221 X-Spam-Level: X-Spam-Status: No, score=-4.221 tagged_above=-999 required=6.31 tests=[HK_RANDOM_FROM=0.001, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id f9jRHXdqM5xG for ; Mon, 10 Apr 2017 09:51:15 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 31D7C60CF7 for ; Mon, 10 Apr 2017 09:51:12 +0000 (UTC) Received: (qmail 81597 invoked by uid 99); 10 Apr 2017 09:51:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Apr 2017 09:51:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 03A8AF21A5; Mon, 10 Apr 2017 09:51:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mxmrlv@apache.org To: dev@ariatosca.incubator.apache.org Date: Mon, 10 Apr 2017 09:51:16 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [07/18] incubator-ariatosca git commit: moved TASK_LOG_NAME archived-at: Mon, 10 Apr 2017 09:51:18 -0000 moved TASK_LOG_NAME Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/2ab146e3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/2ab146e3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/2ab146e3 Branch: refs/heads/logger_task Commit: 2ab146e394b2cae207e6db06a86e070660d0396f Parents: 4275d21 Author: Ran Ziv Authored: Thu Apr 6 16:18:07 2017 +0300 Committer: Ran Ziv Committed: Thu Apr 6 16:18:07 2017 +0300 ---------------------------------------------------------------------- aria/logger.py | 3 +++ aria/orchestrator/context/common.py | 6 ++---- tests/conftest.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2ab146e3/aria/logger.py ---------------------------------------------------------------------- diff --git a/aria/logger.py b/aria/logger.py index e3039f5..bbb6c7a 100644 --- a/aria/logger.py +++ b/aria/logger.py @@ -21,6 +21,9 @@ import logging from logging import handlers as logging_handlers from datetime import datetime +TASK_LOGGER_NAME = 'aria.executions.task' + + _base_logger = logging.getLogger('aria') http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2ab146e3/aria/orchestrator/context/common.py ---------------------------------------------------------------------- diff --git a/aria/orchestrator/context/common.py b/aria/orchestrator/context/common.py index 61ef9c0..11b5eb9 100644 --- a/aria/orchestrator/context/common.py +++ b/aria/orchestrator/context/common.py @@ -29,12 +29,10 @@ from aria import ( ) from aria.storage import exceptions +from ... import logger from ...utils.uuid import generate_uuid -TASK_LOGGER_NAME = 'aria.executions.task' - - class BaseContext(object): """ Base context object for workflow and operation @@ -72,7 +70,7 @@ class BaseContext(object): def _register_logger(self, level=None, task_id=None): self.logger = self.PrefixedLogger( - logging.getLogger(TASK_LOGGER_NAME), self.logging_id, task_id=task_id) + logging.getLogger(logger.TASK_LOGGER_NAME), 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()) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2ab146e3/tests/conftest.py ---------------------------------------------------------------------- diff --git a/tests/conftest.py b/tests/conftest.py index e604eb8..312ee0b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -18,7 +18,7 @@ import logging import pytest import aria -from aria.orchestrator.context import common +from aria import logger @pytest.fixture(scope='session', autouse=True) @@ -38,5 +38,5 @@ def logging_handler_cleanup(request): :return: """ def clear_logging_handlers(): - logging.getLogger(common.TASK_LOGGER_NAME).handlers = [] + logging.getLogger(logger.TASK_LOGGER_NAME).handlers = [] request.addfinalizer(clear_logging_handlers)