MCPcopy
hub / github.com/treeverse/dvc / emit

Method emit

dvc/logger.py:143–162  ·  view source on GitHub ↗

Write to Tqdm's stream so as to not break progress-bars

(self, record)

Source from the content-addressed store, hash-verified

141 return exc.__pretty_exc__(verbose=verbose)
142
143 def emit(self, record):
144 """Write to Tqdm's stream so as to not break progress-bars"""
145 try:
146 if record.exc_info:
147 _, exc, *_ = record.exc_info
148 if hasattr(exc, "__pretty_exc__"):
149 try:
150 self.emit_pretty_exception(exc, verbose=_is_verbose())
151 if not _is_verbose():
152 return
153 except Exception: # noqa: BLE001, S110
154 pass
155
156 msg = self.format(record)
157 Tqdm.write(msg, file=self.stream, end=getattr(self, "terminator", "\n"))
158 self.flush()
159 except (BrokenPipeError, RecursionError):
160 raise
161 except Exception: # noqa: BLE001
162 self.handleError(record)
163
164
165def _is_verbose():

Callers

nothing calls this directly

Calls 5

emit_pretty_exceptionMethod · 0.95
handleErrorMethod · 0.95
_is_verboseFunction · 0.85
writeMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected