Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112410679
  
    --- Diff: aria/cli/execution_logging.py ---
    @@ -14,53 +14,68 @@
     # limitations under the License.
     
     import os
    +from StringIO import StringIO
     
     from . import logger
     from .env import env
     
     DEFAULT_FORMATTING = {
    -    logger.NO_VERBOSE: {'main_msg': '{item.msg}'},
    +    logger.NO_VERBOSE: {'message': '{item.msg}'},
         logger.LOW_VERBOSE: {
    -        'main_msg': '{created_at} | {item.level[0]} | {item.msg}',
    -        'created_at': '%H:%M:%S'
    -    }
    +        'message': '{timestamp} | {item.level[0]} | {item.msg}',
    +        'timestamp': '%H:%M:%S'
    +    },
    +    logger.MEDIUM_VERBOSE: {
    +        'message': '{timestamp} | {item.level[0]} | {item.msg} | 
{implementation}',
    +        'timestamp': '%H:%M:%S'
    +    },
    +    logger.HIGH_VERBOSE: {
    +        'message': '{timestamp} | {item.level[0]} | {item.msg} | 
{implementation}({inputs})',
    +        'timestamp': '%H:%M:%S'
    +    },
     }
     
     
    -class load(object):
    +def _str(item, formatting=None):
    +    # Only NO_VERBOSE and LOW_VERBOSE are configurable formats. configuring
    +    # the low verbose level should affect any higher level.
    +    formats = formatting or DEFAULT_FORMATTING
    +    formatting = formats[env.logging.verbosity_level]
    +    msg = StringIO()
     
    -    def __init__(self, item, formats=None):
    -        self._item = item
    -        self._formats = formats or DEFAULT_FORMATTING
    +    kwargs = dict(item=item)
     
    -    def __repr__(self):
    -        # Only NO_VERBOSE and LOW_VERBOSE are configurable formats. 
configuring
    -        # the low verbose level should affect any higher level.
    -        formats = self._formats[min(env.logging.verbosity_level, 
logger.LOW_VERBOSE)]
    +    if item.task:
    +        kwargs['implementation'] = item.task.implementation
    +        kwargs['inputs'] = dict(i.unwrap() for i in 
item.task.inputs.values())
    +    else:
    +        kwargs['implementation'] = item.execution.workflow_name
    +        kwargs['inputs'] = dict(i.unwrap() for i in 
item.execution.inputs.values())
     
    -        kwargs = dict(item=self._item)
    -        if 'created_at' in formats:
    -            kwargs['created_at'] = 
self._item.created_at.strftime(formats['created_at'])
    -        if 'level' in formats:
    -            kwargs['level'] = formats['level'].format(self._item.level)
    -        if 'msg' in formats:
    -            kwargs['msg'] = formats['msg'].format(self._item.msg)
    +    if 'timestamp' in formatting:
    +        kwargs['timestamp'] = 
item.created_at.strftime(formatting['timestamp'])
    +    else:
    +        kwargs['timestamp'] = item.created_at
     
    -        if 'actor' in formats and self._item.task:
    -            kwargs['actor'] = 
formats['actor'].format(self._item.task.actor)
    -        if 'execution' in formats:
    -            kwargs['execution'] = 
formats['execution'].format(self._item.execution)
    +    # If no format was supplied just print out the original msg.
    +    msg.write(formatting.get('message', '{item.msg}').format(**kwargs))
    --- End diff --
    
    use default


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to