Skip to content

Commit

Permalink
Merge pull request #161 from zonwizard/base-client-logger
Browse files Browse the repository at this point in the history
use the initialized logger for the client.py module
  • Loading branch information
denisneuf authored Sep 1, 2023
2 parents 4c15cc4 + 15eaa08 commit cb39b56
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ad_api/base/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ def _download(self, params: dict = None, headers=None) -> ApiResponse:
elif mode == "data":

if bytes[0:2] == b'\x1f\x8b':
logging.info("Is gzip report")
log.info("Is gzip report")
buf = BytesIO(bytes)
f = gzip.GzipFile(fileobj=buf)
read_data = f.read()
next_token = None
return ApiResponse(json.loads(read_data.decode('utf-8')), next_token, headers=r.headers)

else:
logging.info("Is bytes snapshot")
log.info("Is bytes snapshot")
next_token = None
return ApiResponse(json.loads(r.text), next_token, headers=r.headers)

Expand Down Expand Up @@ -260,7 +260,7 @@ def _request(self,
)

if self.debug:
logging.info(headers or self.headers)
log.info(headers or self.headers)


if params:
Expand All @@ -271,11 +271,11 @@ def _request(self,
else:
message = method + " " + self.endpoint + path

logging.info(message)
log.info(message)
if data is not None:
logging.info(data)
log.info(data)

logging.info(vars(res))
log.info(vars(res))

return self._check_response(res)

Expand Down

0 comments on commit cb39b56

Please sign in to comment.