From c4702ec9b659f68cbc7cd9b16515f596c6321662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 10 Dec 2019 21:30:08 +0100 Subject: [PATCH] simplify some logging calls --- gallery_dl/config.py | 2 +- gallery_dl/downloader/http.py | 4 ++-- gallery_dl/extractor/pinterest.py | 2 +- gallery_dl/extractor/tumblr.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gallery_dl/config.py b/gallery_dl/config.py index 59e048de..785ffc30 100644 --- a/gallery_dl/config.py +++ b/gallery_dl/config.py @@ -57,7 +57,7 @@ def load(files=None, strict=False, fmt="json"): confdict = parsefunc(file) except OSError as exc: if strict: - log.error("%s", exc) + log.error(exc) sys.exit(1) except Exception as exc: log.warning("Could not parse '%s': %s", path, exc) diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py index e66cb60f..fab96ba2 100644 --- a/gallery_dl/downloader/http.py +++ b/gallery_dl/downloader/http.py @@ -99,7 +99,7 @@ class HttpDownloader(DownloaderBase): msg = str(exc) continue except Exception as exc: - self.log.warning("%s", exc) + self.log.warning(exc) return False # check response @@ -116,7 +116,7 @@ class HttpDownloader(DownloaderBase): msg = "'{} {}' for '{}'".format(code, response.reason, url) if code == 429 or 500 <= code < 600: # Server Error continue - self.log.warning("%s", msg) + self.log.warning(msg) return False size = text.parse_int(size) diff --git a/gallery_dl/extractor/pinterest.py b/gallery_dl/extractor/pinterest.py index 912e4678..bcdd082c 100644 --- a/gallery_dl/extractor/pinterest.py +++ b/gallery_dl/extractor/pinterest.py @@ -243,7 +243,7 @@ class PinterestAPI(): if response.status_code == 404 or response.history: resource = self.extractor.subcategory.rpartition("-")[2] raise exception.NotFoundError(resource) - self.extractor.log.debug("%s", response.text) + self.extractor.log.debug("Server response: %s", response.text) raise exception.StopExtraction("API request failed") def _pagination(self, resource, options): diff --git a/gallery_dl/extractor/tumblr.py b/gallery_dl/extractor/tumblr.py index 998eed46..1d37419c 100644 --- a/gallery_dl/extractor/tumblr.py +++ b/gallery_dl/extractor/tumblr.py @@ -156,8 +156,8 @@ class TumblrExtractor(Extractor): invalid = types - POST_TYPES if invalid: types = types & POST_TYPES - self.log.warning('invalid post types: "%s"', - '", "'.join(sorted(invalid))) + self.log.warning("Invalid post types: '%s'", + "', '".join(sorted(invalid))) return types @staticmethod