From c869d4d0fe06f223930ee9d005ae00d148fbb12b Mon Sep 17 00:00:00 2001 From: MarcoHuebner <57489799+MarcoHuebner@users.noreply.github.com> Date: Sat, 27 Aug 2022 23:40:20 +0200 Subject: [PATCH] updated logging due to linting errors W1203 --- src/pygenesis/cache.py | 4 ++-- src/pygenesis/http_helper.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pygenesis/cache.py b/src/pygenesis/cache.py index 5531bf7..db7b503 100644 --- a/src/pygenesis/cache.py +++ b/src/pygenesis/cache.py @@ -90,6 +90,6 @@ def clean_cache(file: Optional[str] = None) -> None: elif file_path.is_dir(): shutil.rmtree(file_path) except (OSError, ValueError, FileNotFoundError) as e: - logger.warning(f"Failed to delete {file_path}. Reason: {e}") + logger.warning("Failed to delete %s. Reason: %s", file_path, e) - logger.info(f"Removed files: {file_paths}") + logger.info("Removed files: %s", file_paths) diff --git a/src/pygenesis/http_helper.py b/src/pygenesis/http_helper.py index 2bde080..cbd7dbf 100644 --- a/src/pygenesis/http_helper.py +++ b/src/pygenesis/http_helper.py @@ -127,4 +127,6 @@ def _check_destatis_status(destatis_status: dict) -> None: # output information to user # TODO: Would logger.info (with forced visibility) be the better option? elif destatis_status_type.lower() == "information": - logger.info(f"Code {destatis_status_code}: {destatis_status_content}") + logger.info( + "Code %d : %s", destatis_status_code, destatis_status_content + )