simplify some logging calls
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user