MCPcopy Index your code
hub / github.com/python/cpython / LogCaptureHandler

Class LogCaptureHandler

Lib/test/test_support.py:32–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31
32class LogCaptureHandler(logging.StreamHandler):
33 # Inspired by pytest's caplog
34 def __init__(self):
35 super().__init__(io.StringIO())
36 self.records = []
37
38 def emit(self, record) -> None:
39 self.records.append(record)
40 super().emit(record)
41
42 def handleError(self, record):
43 raise
44
45
46@contextlib.contextmanager

Callers 1

_caplogFunction · 0.85

Calls

no outgoing calls

Tested by 1

_caplogFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…