Skip to content

Commit

Permalink
set logging request lines to INFO level for async method also (#2656)
Browse files Browse the repository at this point in the history
  • Loading branch information
oczkers committed Apr 12, 2023
1 parent 579a3f2 commit 4b5a92e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions httpx/_client.py
Expand Up @@ -1726,10 +1726,13 @@ async def _send_single_request(self, request: Request) -> Response:
self.cookies.extract_cookies(response)
response.default_encoding = self._default_encoding

status = f"{response.status_code} {response.reason_phrase}"
response_line = f"{response.http_version} {status}"
logger.debug(
'HTTP Request: %s %s "%s"', request.method, request.url, response_line
logger.info(
'HTTP Request: %s %s "%s %d %s"',
request.method,
request.url,
response.http_version,
response.status_code,
response.reason_phrase,
)

return response
Expand Down

0 comments on commit 4b5a92e

Please sign in to comment.