logger.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:octario 作者: redhat-openstack 项目源码 文件源码
def octario_excepthook(exc_type, exc_value, exc_traceback):
    """exception hook that sends OctarioException to log and other

    exceptions to stderr (default excepthook)
    """
    from octario.lib.exceptions import OctarioException

    # sends full exception with trace to log
    if not isinstance(exc_value, OctarioException):
        return sys.__excepthook__(exc_type, exc_value, exc_traceback)

    if LOG.getEffectiveLevel() <= logging.DEBUG:
        formated_exception = "".join(
            traceback.format_exception(exc_type, exc_value, exc_traceback))
        LOG.error(formated_exception + exc_value.message)
    else:
        LOG.error(exc_value.message)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号