We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 76215ea commit ff1e21bCopy full SHA for ff1e21b
1 file changed
src/_pytask/logging.py
@@ -39,6 +39,12 @@
39
pass
40
41
42
+if TYPE_CHECKING:
43
+ LoggingStreamHandler = logging.StreamHandler[io.StringIO]
44
+else:
45
+ LoggingStreamHandler = logging.StreamHandler
46
+
47
48
DEFAULT_LOG_FORMAT = "%(levelname)-8s %(name)s:%(filename)s:%(lineno)d %(message)s"
49
DEFAULT_LOG_DATE_FORMAT = "%H:%M:%S"
50
@@ -287,7 +293,7 @@ def _humanize_time( # noqa: C901, PLR0912
287
293
return result
288
294
289
295
290
-class LogCaptureHandler(logging.StreamHandler[io.StringIO]):
296
+class LogCaptureHandler(LoggingStreamHandler):
291
297
"""Capture logs in a string buffer."""
292
298
299
def __init__(self) -> None:
0 commit comments