0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.147.51.72


Current Path : /proc/self/root/usr/lib/python3/dist-packages/landscape/lib/
Upload File :
Current File : //proc/self/root/usr/lib/python3/dist-packages/landscape/lib/log.py

from __future__ import absolute_import

import logging


def log_failure(failure, msg=None, logger=None):
    """Log a L{twisted.python.failure.Failure} to the Python L{logging} module.

    The failure should be formatted as a regular exception, but a traceback may
    not be available.

    If C{msg} is passed, it will included before the traceback.
    """
    if logger is None:
        logger = logging
    logger.error(msg, exc_info=(failure.type, failure.value, failure.tb))