[BE]: Enable Ruff + Flake8 G201,G202 logging format rule. (#114474)

Standardizes logging calls to always use logging.exception instead of logging.error where appropriate and enforces it with a lint.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/114474
Approved by: https://github.com/jansel, https://github.com/malfet
This commit is contained in:
Aaron Gokaslan
2023-11-27 17:38:08 +00:00
committed by PyTorch MergeBot
parent 3a4dea99df
commit 4bb3a02d02
8 changed files with 15 additions and 18 deletions

View File

@ -477,14 +477,13 @@ class MultiprocessContext(PContext):
failed_proc = self._pc.processes[failed_local_rank]
error_filepath = self.error_files[failed_local_rank]
log.error(
log.exception(
"failed (exitcode: %s)"
" local_rank: %s (pid: %s)"
" of fn: %s (start_method: %s)",
failed_proc.exitcode,
failed_local_rank, e.pid,
fn_name, self.start_method,
exc_info=True,
)
self.close()