handlers.py 文件源码

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

项目:filters 作者: eflglobal 项目源码 文件源码
def __init__(self, capture_exc_info=False):
        # type: (bool) -> None
        """
        :param capture_exc_info:
            Whether to capture `sys.exc_info` when an handling an
            exception.

            This is turned off by default to reduce memory usage, but
            it is useful in certain cases (e.g., if you want to send
            exceptions to a logger that expect exc_info).

            Regardless, you can still check ``self.has_exceptions`` to
            see if an exception occurred.
        """
        super(MemoryHandler, self).__init__()

        self.messages           = OrderedDict() # type: Union[OrderedDict, Dict[Text, List[FilterMessage]]]
        self.has_exceptions     = False
        self.capture_exc_info   = capture_exc_info
        self.exc_info           = [] # type: List[Tuple[type, Exception, TracebackType]]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号