Skip to content

Commit

Permalink
exchange.py print()
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Mar 27, 2020
1 parent 1bd37cf commit dbbaa92
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/ccxt/base/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# -----------------------------------------------------------------------------

__version__ = '1.25.28'
__version__ = '1.25.29'

# -----------------------------------------------------------------------------

Expand Down Expand Up @@ -512,13 +512,16 @@ def prepare_request_headers(self, headers=None):
headers.update({'Accept-Encoding': 'gzip, deflate'})
return headers

def print(self, *args):
print(*args)

def fetch(self, url, method='GET', headers=None, body=None):
"""Perform a HTTP request and return decoded JSON data"""
request_headers = self.prepare_request_headers(headers)
url = self.proxy + url

if self.verbose:
print("\nRequest:", method, url, request_headers, body)
self.print("\nRequest:", method, url, request_headers, body)
self.logger.debug("%s %s, Request: %s %s", method, url, request_headers, body)

request_body = body
Expand Down Expand Up @@ -554,7 +557,7 @@ def fetch(self, url, method='GET', headers=None, body=None):
if self.enableLastResponseHeaders:
self.last_response_headers = headers
if self.verbose:
print("\nResponse:", method, url, http_status_code, headers, http_response)
self.print("\nResponse:", method, url, http_status_code, headers, http_response)
self.logger.debug("%s %s, Response: %s %s %s", method, url, http_status_code, headers, http_response)
response.raise_for_status()

Expand Down

0 comments on commit dbbaa92

Please sign in to comment.