Skip to content

Commit

Permalink
Use self.log rather than logging module directly
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yuvipanda committed Nov 26, 2024
1 parent 3977884 commit f4fac25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions repo2docker/contentproviders/doi.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def doi2url(self, doi):
# Reraise any other errors because if the DOI service is down (or
# we hit a rate limit) we don't want to silently continue to the
# default Git provider as this leads to a misleading error.
logging.error(f"DOI {doi} does not resolve: {e}")
self.log.error(f"DOI {doi} does not resolve: {e}")
raise
return resp.url
else:
Expand All @@ -70,7 +70,7 @@ def fetch_file(self, file_ref, host, output_dir, unzip=False):
# file related to a record
file_url = deep_get(file_ref, host["download"])
fname = deep_get(file_ref, host["filename"])
logging.debug(f"Downloading file {file_url} as {fname}\n")
self.log.debug(f"Downloading file {file_url} as {fname}\n")

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

0 comments on commit f4fac25

Please sign in to comment.