Skip to content

Commit 8692663

Browse files
committed
Reduce download logging
Remove logging when an exception is raised. Reduce logging level to debug. Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
1 parent 8c22294 commit 8692663

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tuf/ngclient/_internal/download.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@
2222
length of a downloaded file has to match the hash and length supplied by the
2323
metadata of that file.
2424
"""
25-
2625
import logging
2726
import tempfile
2827
from urllib import parse
2928

3029
from tuf import exceptions
3130

32-
# See 'log.py' to learn how logging is handled in TUF.
3331
logger = logging.getLogger(__name__)
3432

3533

@@ -66,7 +64,7 @@ def download_file(url, required_length, fetcher):
6664
# encoded as %5c in the url, which should also be replaced with a forward
6765
# slash.
6866
url = parse.unquote(url).replace("\\", "/")
69-
logger.info("Downloading: %s", url)
67+
logger.debug("Downloading: %s", url)
7068

7169
# This is the temporary file that we will return to contain the contents of
7270
# the downloaded file.
@@ -88,7 +86,6 @@ def download_file(url, required_length, fetcher):
8886
except Exception:
8987
# Close 'temp_file'. Any written data is lost.
9088
temp_file.close()
91-
logger.debug("Could not download URL: %s", url)
9289
raise
9390

9491
else:

0 commit comments

Comments
 (0)