diff --git a/fyle/platform/internals/api_base.py b/fyle/platform/internals/api_base.py index 819935a..c9b16bf 100644 --- a/fyle/platform/internals/api_base.py +++ b/fyle/platform/internals/api_base.py @@ -2,6 +2,7 @@ Define ApiBase class implementing API helper methods. """ +import logging import json from .decorators import retry @@ -10,6 +11,8 @@ from ..globals.config import config +logger = logging.getLogger(__name__) + class ApiBase(Network): """The base class for all API classes.""" @@ -57,9 +60,11 @@ def make_get_request(self, api_url, query_params=None): ) if response.status_code == 200: + logger.debug('Response for get request for url: %s, %s', api_url, response.text) result = json.loads(response.text) return result + logger.info('Response for get request for url: %s, %s', api_url, response.text) ApiBase._assert_response(response) @retry(n=3, backoff=5, exceptions=exceptions.InvalidTokenError) @@ -83,10 +88,14 @@ def make_post_request(self, api_url, payload): data=payload ) + logger.debug('Payload for post request: %s', payload) + if response.status_code == 200: + logger.debug('Response for post request: %s', response.text) result = json.loads(response.text) return result - + + logger.info('Response for post request: %s', response.text) ApiBase._assert_response(response) diff --git a/setup.py b/setup.py index b7ceda7..37c5bda 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name='fyle', - version='v0.37.1', + version='v0.37.2', author='Siva Narayanan', author_email='siva@fyle.in', description='Python SDK for accessing Fyle Platform APIs',