Example #1
0
    def __init__(self, message, level="INFO"):
        """Initializes a RIDE log message.

        The log ``level`` has default value ``INFO`` and the ``timestamp``
        is generated automatically.
        """
        RideMessage.__init__(self, message=message, level=level, timestamp=utils.get_timestamp())
Example #2
0
    def __init__(self, message, level='INFO', notify_user=False):
        """Initializes a RIDE log message.

        The log ``level`` has default value ``INFO`` and the ``timestamp``
        is generated automatically.
        """
        RideMessage.__init__(
            self, message=message, level=level,
            timestamp=utils.get_timestamp(), notify_user=notify_user)
Example #3
0
    def __init__(self, message, exception, level='INFO'):
        """Initializes a RIDE log exception.

        The log ``level`` has default value ``INFO`` and the ``timestamp``
        is generated automatically. Message is automatically appended with
        a traceback.
        """
        exc_type, exc_value, exc_traceback = sys.exc_info()
        if exc_traceback:
            tb = traceback.extract_tb(exc_traceback)
            message += '\n\nTraceback (most recent call last):\n%s\n%s' % (unicode(exception) ,''.join(traceback.format_list(tb)))
        RideMessage.__init__(self, message=message, level=level,
                             timestamp=utils.get_timestamp(),
                             exception=exception)
Example #4
0
    def __init__(self, message, exception, level='INFO', notify_user=False):
        """Initializes a RIDE log exception.

        The log ``level`` has default value ``INFO`` and the ``timestamp``
        is generated automatically. Message is automatically appended with
        a traceback.
        """
        exc_type, exc_value, exc_traceback = sys.exc_info()
        if exc_traceback:
            tb = traceback.extract_tb(exc_traceback)
            message += '\n\nTraceback (most recent call last):\n%s\n%s' % \
                (unicode(exception), ''.join(traceback.format_list(tb)))
        RideMessage.__init__(
            self, message=message, level=level, notify_user=False,
            timestamp=utils.get_timestamp(), exception=exception)