From 80a18ab005df772f2f4a80565a3a67cdd65efc84 Mon Sep 17 00:00:00 2001 From: Till Prochaska Date: Tue, 21 Nov 2023 09:26:22 +0100 Subject: [PATCH] Use f-string for log messages As suggested by @catileptic --- ingestors/manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ingestors/manager.py b/ingestors/manager.py index 8b81bde79..c0d3425e1 100644 --- a/ingestors/manager.py +++ b/ingestors/manager.py @@ -199,7 +199,7 @@ def ingest(self, file_path, entity, **kwargs): try: ingestor_class = self.auction(file_path, entity) ingestor_name = ingestor_class.__name__ - log.info("Ingestor [%r]: %s", entity, ingestor_name) + log.info(f"Ingestor [{repr(entity)}]: {ingestor_name}") start_time = default_timer() self.delegate(ingestor_class, file_path, entity) @@ -213,7 +213,7 @@ def ingest(self, file_path, entity, **kwargs): entity.set("processingStatus", self.STATUS_SUCCESS) except ProcessingException as pexc: - log.exception("[%r] Failed to process: %s", entity, pexc) + log.exception(f"[{repr(entity)}] Failed to process: {pexc}") if ingestor_name: INGESTIONS_FAILED.labels(ingestor=ingestor_name).inc()