refactor: don't use f-string on logging statements

The strings are now be formatted if the logging level is enabled.
This commit is contained in:
jo 2023-02-26 12:01:59 +01:00 committed by Kyle Robbertze
parent c414068c16
commit 861698987c
23 changed files with 94 additions and 84 deletions

View file

@ -102,17 +102,17 @@ class Importer:
raise RuntimeError(f"could not upload {filepath}") from exception
def _delete_file(self, filepath: Path) -> None:
logger.info(f"deleting {filepath}")
logger.info("deleting %s", filepath)
filepath.unlink()
def _handle_file(self, filepath: Path, library: Optional[str]) -> None:
logger.debug(f"handling file {filepath}")
logger.debug("handling file %s", filepath)
if not filepath.is_file():
raise ValueError(f"provided path {filepath} is not a file")
if self._check_file_md5(filepath):
logger.info(f"found similar md5sum, ignoring {filepath}")
logger.info("found similar md5sum, ignoring %s", filepath)
if self.delete_if_exists:
self._delete_file(filepath)
return