Skip to content

Commit f4fac25

Browse files
committed
Use self.log rather than logging module directly
Using logging.info or .debug directly sets up the root logger, and after that call every single message is duplicated! This showed up only when using the dataverse provider. With this, no messages are duplicated
1 parent 3977884 commit f4fac25

File tree

1 file changed

+2
-2
lines changed
  • repo2docker/contentproviders

1 file changed

+2
-2
lines changed

repo2docker/contentproviders/doi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def doi2url(self, doi):
5858
# Reraise any other errors because if the DOI service is down (or
5959
# we hit a rate limit) we don't want to silently continue to the
6060
# default Git provider as this leads to a misleading error.
61-
logging.error(f"DOI {doi} does not resolve: {e}")
61+
self.log.error(f"DOI {doi} does not resolve: {e}")
6262
raise
6363
return resp.url
6464
else:
@@ -70,7 +70,7 @@ def fetch_file(self, file_ref, host, output_dir, unzip=False):
7070
# file related to a record
7171
file_url = deep_get(file_ref, host["download"])
7272
fname = deep_get(file_ref, host["filename"])
73-
logging.debug(f"Downloading file {file_url} as {fname}\n")
73+
self.log.debug(f"Downloading file {file_url} as {fname}\n")
7474

7575
yield f"Requesting {file_url}\n"
7676
resp = self._request(file_url, stream=True)

0 commit comments

Comments
 (0)