Skip to content

Commit

Permalink
chore(client): log response headers in debug mode (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored Apr 29, 2024
1 parent c3133e1 commit d1c4d14
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/anthropic/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,8 @@ def _request(
if self.custom_auth is not None:
kwargs["auth"] = self.custom_auth

log.debug("Sending HTTP Request: %s %s", request.method, request.url)

try:
response = self._client.send(
request,
Expand Down Expand Up @@ -984,7 +986,12 @@ def _request(
raise APIConnectionError(request=request) from err

log.debug(
'HTTP Request: %s %s "%i %s"', request.method, request.url, response.status_code, response.reason_phrase
'HTTP Response: %s %s "%i %s" %s',
request.method,
request.url,
response.status_code,
response.reason_phrase,
response.headers,
)

try:
Expand Down

0 comments on commit d1c4d14

Please sign in to comment.