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]]
评论列表
文章目录