MCPcopy
hub / github.com/pallets/werkzeug / _ColorStreamHandler

Class _ColorStreamHandler

src/werkzeug/_internal.py:64–75  ·  view source on GitHub ↗

On Windows, wrap stream with Colorama for ANSI style support.

Source from the content-addressed store, hash-verified

62
63
64class _ColorStreamHandler(logging.StreamHandler): # type: ignore[type-arg]
65 """On Windows, wrap stream with Colorama for ANSI style support."""
66
67 def __init__(self) -> None:
68 try:
69 import colorama
70 except ImportError:
71 stream = None
72 else:
73 stream = colorama.AnsiToWin32(sys.stderr)
74
75 super().__init__(stream)
76
77
78def _log(type: str, message: str, *args: t.Any, **kwargs: t.Any) -> None:

Callers 1

_logFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected