MCPcopy Create free account
hub / github.com/cswry/VOSR / SafeFileHandler

Class SafeFileHandler

train_vosr_distill.py:222–234  ·  view source on GitHub ↗

FileHandler that silently ignores flush errors on filesystems that don't support it.

Source from the content-addressed store, hash-verified

220 p.requires_grad = flag
221
222class SafeFileHandler(logging.FileHandler):
223 """FileHandler that silently ignores flush errors on filesystems that don't support it."""
224 def flush(self):
225 try:
226 super().flush()
227 except OSError:
228 pass
229
230 def emit(self, record):
231 try:
232 super().emit(record)
233 except OSError:
234 pass
235
236def create_logger(logging_dir):
237 """

Callers 1

create_loggerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected