From b67eb29d26475495817df70ac5d7eb50254e9cab Mon Sep 17 00:00:00 2001 From: Ashutosh619-sudo Date: Tue, 8 Oct 2024 17:46:03 +0530 Subject: [PATCH] better logging --- sageintacctsdk/apis/api_base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sageintacctsdk/apis/api_base.py b/sageintacctsdk/apis/api_base.py index 10073d1..d00187f 100644 --- a/sageintacctsdk/apis/api_base.py +++ b/sageintacctsdk/apis/api_base.py @@ -200,9 +200,8 @@ def __post_request(self, dict_body: dict, api_url: str): parsed_xml = xmltodict.parse(raw_response, force_list={self.__dimension})['root'] parsed_response = json.loads(json.dumps(parsed_xml)) - - logger.debug('Response for post request: %s', raw_response.text) if raw_response.status_code == 200: + logger.debug('Response for post request: %s', raw_response.text) if parsed_response['response']['control']['status'] == 'success': api_response = parsed_response['response']['operation'] @@ -242,6 +241,8 @@ def __post_request(self, dict_body: dict, api_url: str): } raise WrongParamsError('Something went wrong', custom_response) + + logger.info('Response for post request: %s', raw_response.text) if 'result' in parsed_response: if 'errormessage' in parsed_response['result']: parsed_response = parsed_response['result']['errormessage']