Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-146-Support-colorful-execution-logging ed350ca42 -> fea7a0c34
modified executions logging Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/fea7a0c3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/fea7a0c3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/fea7a0c3 Branch: refs/heads/ARIA-146-Support-colorful-execution-logging Commit: fea7a0c34f496f1b7d63a2684086753c71a35ea3 Parents: ed350ca Author: max-orlov <[email protected]> Authored: Sat Apr 22 11:09:15 2017 +0300 Committer: max-orlov <[email protected]> Committed: Sat Apr 22 11:09:15 2017 +0300 ---------------------------------------------------------------------- aria/cli/commands/executions.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fea7a0c3/aria/cli/commands/executions.py ---------------------------------------------------------------------- diff --git a/aria/cli/commands/executions.py b/aria/cli/commands/executions.py index 3eb53ab..a156c3f 100644 --- a/aria/cli/commands/executions.py +++ b/aria/cli/commands/executions.py @@ -20,6 +20,7 @@ from .. import table from .. import utils from .. import logger as cli_logger from .. import execution_logging +from .. import color from ..core import aria from ...modeling.models import Execution from ...orchestrator.workflow_runner import WorkflowRunner @@ -165,9 +166,13 @@ def start(workflow_name, execution_thread.raise_error_if_exists() execution = workflow_runner.execution - logger.info('Execution has ended with "{0}" status'.format(execution.status)) + status_msg = 'Execution has ended with "{0}" status'.format(execution.status) + status_msg = color.StyledString(status_msg, color.StyledString.FORE.RED) + logger.info(status_msg) if execution.status == Execution.FAILED and execution.error: - logger.info('Execution error:{0}{1}'.format(os.linesep, execution.error)) + error_msg = color.StyledString('Execution error:{0}{1}'.format(os.linesep, execution.error), + color.StyledString.FORE.RED) + logger.info(error_msg) if dry: # remove traces of the dry execution (including tasks, logs, inputs..)
