MCPcopy Create free account
hub / github.com/microsoft/debugpy / write_format

Function write_format

src/debugpy/common/log.py:146–157  ·  view source on GitHub ↗
(level, format_string, *args, **kwargs)

Source from the content-addressed store, hash-verified

144
145
146def write_format(level, format_string, *args, **kwargs):
147 # Don't spend cycles doing expensive formatting if we don't have to. Errors are
148 # always formatted, so that error() can return the text even if it's not logged.
149 if level != "error" and level not in _levels:
150 return
151
152 try:
153 text = format_string.format(*args, **kwargs)
154 except Exception: # pragma: no cover
155 reraise_exception()
156
157 return write(level, text, kwargs.pop("_to_files", all))
158
159
160debug = functools.partial(write_format, "debug")

Callers 2

errorFunction · 0.85
_exceptionFunction · 0.85

Calls 3

reraise_exceptionFunction · 0.85
popMethod · 0.80
writeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…