Skip to content
Snippets Groups Projects
Commit 398d8bf5 authored by Alan De Smet's avatar Alan De Smet
Browse files

Use logging.progress if available.

Only for a few very high level things. If not available, route it to
logging.info
parent cbc4ffa6
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,15 @@ if sys.version_info < MIN_PYTHON_TUPLE: ...@@ -37,6 +37,15 @@ if sys.version_info < MIN_PYTHON_TUPLE:
def logprogress(msg):
""" Pass to logging.progress if available, otherwise logging.info """
try:
logging.progress(msg)
return
except:
pass
logging.info(msg)
...@@ -778,15 +787,17 @@ class Downloader: ...@@ -778,15 +787,17 @@ class Downloader:
for attempt in range(1, retries+1): for attempt in range(1, retries+1):
if retries > 1: if retries > 1:
logging.info(f"Attempt {attempt}") logprogress(f"Attempt {attempt}")
for fileset in filesets: for fileset in filesets:
description = fileset.description description = fileset.description
expected = fileset.expected expected = fileset.expected
urls_to_files = fileset.urls_to_files urls_to_files = fileset.urls_to_files
logging.info(f"Working on {description}") logprogress(f" Working on {description}")
logging.info(f" files to get: {urls_to_files}")
for base_url in base_urls: for base_url in base_urls:
full_urls_to_file = {base_url+suffix: dst+"/"+value for suffix,value in urls_to_files.items()} full_urls_to_file = {base_url+suffix: dst+"/"+value for suffix,value in urls_to_files.items()}
logging.info(f" Trying {base_url}")
try: try:
logging.debug(f"Considering {full_urls_to_file}") logging.debug(f"Considering {full_urls_to_file}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment