[ 
https://issues.apache.org/jira/browse/ARIA-138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15974794#comment-15974794
 ] 

ASF GitHub Bot commented on ARIA-138:
-------------------------------------

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

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112216372
  
    --- Diff: aria/cli/execution_logging.py ---
    @@ -0,0 +1,66 @@
    +# Licensed to the Apache Software Foundation (ASF) under one or more
    +# contributor license agreements.  See the NOTICE file distributed with
    +# this work for additional information regarding copyright ownership.
    +# The ASF licenses this file to You under the Apache License, Version 2.0
    +# (the "License"); you may not use this file except in compliance with
    +# the License.  You may obtain a copy of the License at
    +#
    +#     http://www.apache.org/licenses/LICENSE-2.0
    +#
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS,
    +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +# See the License for the specific language governing permissions and
    +# limitations under the License.
    +
    +import os
    +
    +from . import logger
    +from .env import env
    +
    +DEFAULT_FORMATTING = {
    +    logger.NO_VERBOSE: {'main_msg': '{item.msg}'},
    +    logger.LOW_VERBOSE: {
    +        'main_msg': '{created_at} | {item.level[0]} | {item.msg}',
    +        'created_at': '%H:%M:%S'
    +    }
    +}
    +
    +
    +class load(object):
    +
    +    def __init__(self, item, formats=None):
    +        self._item = item
    +        self._formats = formats or DEFAULT_FORMATTING
    +
    +    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)]
    +
    +        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:
    --- End diff --
    
    no need


> CLI output verbosity levels
> ---------------------------
>
>                 Key: ARIA-138
>                 URL: https://issues.apache.org/jira/browse/ARIA-138
>             Project: AriaTosca
>          Issue Type: Story
>            Reporter: Maxim Orlov
>            Assignee: Maxim Orlov
>
> The CLI should support the display of the following logging levels:
> default: execution logs: simple representation of executed operations
> -v      : execution logs: representation with time stamps and logging levels
> -vv    : execution logs: retrieve the stacktrace of any failed operation.
> -vvv  : all configured loggers should be set to {{debug}} level; any CLI 
> errors should be logged and printed with their stack trace as well.
> (both the default and the first level of logging format should be 
> configurable). 
> Note that all of the operations logs should be saved in the storage. This 
> issue relates only to the way the logs are displayed in the CLI.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to