Write to Tqdm's stream so as to not break progress-bars
(self, record)
| 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 | |
| 165 | def _is_verbose(): |
nothing calls this directly
no test coverage detected