You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by mxmrlv <gi...@git.apache.org> on 2017/04/19 14:14:46 UTC

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

GitHub user mxmrlv opened a pull request:

    https://github.com/apache/incubator-ariatosca/pull/104

    ARIA-138-Make-logging-more-informative

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-ariatosca ARIA-138-Make-logging-more-informative

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-ariatosca/pull/104.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #104
    
----
commit d90194dcfa35b4cf0e833449c58de10336c79971
Author: max-orlov <ma...@gigaspaces.com>
Date:   2017-04-19T14:14:15Z

    ARIA-138-Make-logging-more-informative

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112435567
  
    --- Diff: aria/cli/commands/logs.py ---
    @@ -12,13 +12,12 @@
     # 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.
    -
    -from .. import utils
    -from ..core import aria
    +from ..logger import ModelLogIterator
    +from .. core import aria
    --- End diff --
    
    ?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112405930
  
    --- Diff: aria/cli/commands/executions.py ---
    @@ -144,17 +144,17 @@ def start(workflow_name,
         logger.info('Starting {0}execution. Press Ctrl+C cancel'.format('dry ' if dry else ''))
         execution_thread.start()
     
    -    log_consumer = cli_logger.ModelLogConsumer(model_storage, workflow_runner.execution_id)
    +    log_iterator = cli_logger.ModelLogIterator(model_storage, workflow_runner.execution_id)
         try:
             while execution_thread.is_alive():
    -            for log in log_consumer:
    -                execution_logging.load(log).log()
    +            execution_logging.drain(log_iterator)
     
    --- End diff --
    
    join


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112217210
  
    --- Diff: aria/orchestrator/context/common.py ---
    @@ -38,43 +38,44 @@ class BaseContext(object):
         """
     
         class PrefixedLogger(object):
    -        def __init__(self, logger, prefix='', task_id=None):
    -            self._logger = logger
    -            self._prefix = prefix
    +        def __init__(self, base_logger, task_id=None):
    +            self._logger = base_logger
                 self._task_id = task_id
     
             def __getattr__(self, item):
    --- End diff --
    
    , attr...


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112408517
  
    --- Diff: aria/orchestrator/workflows/events_logging.py ---
    @@ -24,23 +24,31 @@
     from .. import events
     
     
    +def _get_task_name(task):
    +    if hasattr(task.actor, 'source_node'):
    --- End diff --
    
    isinstance


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by ran-z <gi...@git.apache.org>.
Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112417076
  
    --- Diff: aria/cli/commands/executions.py ---
    @@ -19,6 +19,8 @@
     from .. import table
     from .. import utils
     from ..core import aria
    +from .. import logger as cli_logger
    --- End diff --
    
    move above the previous import


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112213856
  
    --- Diff: aria/cli/commands/__init__.py ---
    @@ -1,3 +1,4 @@
    +
    --- End diff --
    
    remove


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112213890
  
    --- Diff: aria/cli/commands/executions.py ---
    @@ -141,13 +143,19 @@ def start(workflow_name,
     
         logger.info('Starting {0}execution. Press Ctrl+C cancel'.format('dry ' if dry else ''))
         execution_thread.start()
    +
    +    log_consumer = cli_logger.ModelLogConsumer(model_storage, workflow_runner.execution_id)
    --- End diff --
    
    Iterator


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112215420
  
    --- 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):
    --- End diff --
    
    remove class


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112435477
  
    --- Diff: aria/cli/commands/executions.py ---
    @@ -161,11 +170,13 @@ def start(workflow_name,
             model_storage.execution.delete(execution)
     
     
    -def _cancel_execution(workflow_runner, execution_thread, logger):
    +def _cancel_execution(model_storage, workflow_runner, execution_thread, logger):
         logger.info('Cancelling execution. Press Ctrl+C again to force-cancel')
    +    log_iterator = cli_logger.ModelLogIterator(model_storage, workflow_runner.execution_id)
    --- End diff --
    
    use existing


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by ran-z <gi...@git.apache.org>.
Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112417099
  
    --- Diff: aria/cli/commands/logs.py ---
    @@ -12,13 +12,12 @@
     # 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.
    -
    -from .. import utils
    -from ..core import aria
    +from ..logger import ModelLogIterator
    +from ..cli import aria
    --- End diff --
    
    this line is wrong


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-ariatosca/pull/104


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112218544
  
    --- Diff: aria/orchestrator/workflows/core/engine.py ---
    @@ -40,6 +41,7 @@ class Engine(logger.LoggerMixin):
     
         def __init__(self, executor, workflow_context, tasks_graph, **kwargs):
             super(Engine, self).__init__(**kwargs)
    +        self.logger.addHandler(logging.NullHandler())
    --- End diff --
    
    look up NullHandlers in code and make sure it makes sense


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112406038
  
    --- Diff: aria/cli/commands/executions.py ---
    @@ -144,17 +144,17 @@ def start(workflow_name,
         logger.info('Starting {0}execution. Press Ctrl+C cancel'.format('dry ' if dry else ''))
         execution_thread.start()
     
    -    log_consumer = cli_logger.ModelLogConsumer(model_storage, workflow_runner.execution_id)
    +    log_iterator = cli_logger.ModelLogIterator(model_storage, workflow_runner.execution_id)
         try:
             while execution_thread.is_alive():
    -            for log in log_consumer:
    -                execution_logging.load(log).log()
    +            execution_logging.drain(log_iterator)
     
         except KeyboardInterrupt:
             _cancel_execution(workflow_runner, execution_thread, logger)
     
    -    for log in log_consumer:
    -        execution_logging.load(log).log()
    +    # It might be the case where some logs were written and the execution was terminated, thus we
    +    # need to drain the remaining logs.
    +    execution_logging.drain(log_iterator)
    --- End diff --
    
    177 : add logging


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112435493
  
    --- Diff: aria/cli/commands/executions.py ---
    @@ -141,12 +143,19 @@ def start(workflow_name,
     
         logger.info('Starting {0}execution. Press Ctrl+C cancel'.format('dry ' if dry else ''))
         execution_thread.start()
    +
    +    log_iterator = cli_logger.ModelLogIterator(model_storage, workflow_runner.execution_id)
         try:
             while execution_thread.is_alive():
    -            # using join without a timeout blocks and ignores KeyboardInterrupt
    +            execution_logging.log_list(log_iterator)
                 execution_thread.join(1)
    +
         except KeyboardInterrupt:
    -        _cancel_execution(workflow_runner, execution_thread, logger)
    +        _cancel_execution(model_storage, workflow_runner, execution_thread, logger)
    --- End diff --
    
    move model_storage later


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112436004
  
    --- Diff: aria/orchestrator/workflows/core/engine.py ---
    @@ -40,6 +40,7 @@ class Engine(logger.LoggerMixin):
     
         def __init__(self, executor, workflow_context, tasks_graph, **kwargs):
             super(Engine, self).__init__(**kwargs)
    +        self.logger.addHandler(logger.NullHandler())
    --- End diff --
    
    ???


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112435593
  
    --- Diff: aria/cli/commands/logs.py ---
    @@ -12,13 +12,12 @@
     # 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.
    -
    -from .. import utils
    -from ..core import aria
    +from ..logger import ModelLogIterator
    +from .. core import aria
    --- End diff --
    
    should also be before logger


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112408993
  
    --- 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)
    --- End diff --
    
    rename


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #104: ARIA-138-Make-logging-more-informativ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/104#discussion_r112219717
  
    --- Diff: aria/orchestrator/workflows/core/engine.py ---
    @@ -20,6 +20,7 @@
     import time
    --- End diff --
    
    visit dry.py and check output


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---