Skip to content

Commit 9daccac

Browse files
committed
Reduce logging in requests_fetcher
Remove repetitive debug logging. Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
1 parent 35fb22c commit 9daccac

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

tuf/ngclient/_internal/requests_fetcher.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,6 @@ def _chunks(self, response, required_length):
124124
# We might have no more data to read. Check number of bytes
125125
# downloaded.
126126
if not data:
127-
logger.debug(
128-
"Downloaded %d out of %d bytes",
129-
bytes_received,
130-
required_length,
131-
)
132-
133127
# Finally, we signal that the download is complete.
134128
break
135129

@@ -138,6 +132,12 @@ def _chunks(self, response, required_length):
138132
if bytes_received >= required_length:
139133
break
140134

135+
logger.debug(
136+
"Downloaded %d out of %d bytes",
137+
bytes_received,
138+
required_length,
139+
)
140+
141141
except urllib3.exceptions.ReadTimeoutError as e:
142142
raise exceptions.SlowRetrievalError(str(e))
143143

@@ -158,10 +158,6 @@ def _get_session(self, url):
158158
)
159159

160160
session_index = parsed_url.scheme + "+" + parsed_url.hostname
161-
162-
logger.debug("url: %s", url)
163-
logger.debug("session index: %s", session_index)
164-
165161
session = self._sessions.get(session_index)
166162

167163
if not session:

0 commit comments

Comments
 (0)