From 88ce927372aff2d16fa1f5a5ba5420b4f798e70d Mon Sep 17 00:00:00 2001 From: Roman Zydyk Date: Thu, 23 Oct 2025 13:40:24 +0200 Subject: [PATCH] Use logging instead of print --- polygon/rest/base.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/polygon/rest/base.py b/polygon/rest/base.py index 76cf1430..7501f5ce 100644 --- a/polygon/rest/base.py +++ b/polygon/rest/base.py @@ -113,8 +113,8 @@ def _get( print_headers["Authorization"] = print_headers["Authorization"].replace( self.API_KEY, "REDACTED" ) - print(f"Request URL: {full_url}") - print(f"Request Headers: {print_headers}") + logger.info("Request URL: %s", full_url) + logger.info("Request Headers: %s", print_headers) resp = self.client.request( "GET", @@ -125,7 +125,7 @@ def _get( if self.trace: resp_headers_dict = dict(resp.headers.items()) - print(f"Response Headers: {resp_headers_dict}") + logger.info("Response Headers: %s", resp_headers_dict) if resp.status != 200: raise BadResponse(resp.data.decode("utf-8")) @@ -136,7 +136,7 @@ def _get( try: obj = self._decode(resp) except ValueError as e: - print(f"Error decoding json response: {e}") + logger.error("Error decoding json response: %s", e) return [] if result_key: @@ -222,7 +222,7 @@ def _paginate_iter( try: decoded = self._decode(resp) except ValueError as e: - print(f"Error decoding json response: {e}") + logger.error("Error decoding json response: %s", e) return [] if result_key not in decoded: