-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add extensive loggers #29
Conversation
qbosdk/apis/api_base.py
Outdated
|
||
|
||
logger = logging.getLogger(__name__) | ||
logger.level = logging.WARNING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not required
@@ -246,6 +253,8 @@ def _post_request(self, data, api_url): | |||
if response.status_code == 200: | |||
result = json.loads(response.text) | |||
return result | |||
|
|||
logger.debug('Response for post request: %s', response.text) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do logger.info for all non 2xx status code
logger.debug you can move it to 2xx block
qbosdk/apis/api_base.py
Outdated
@@ -9,6 +9,11 @@ | |||
from ..exceptions import WrongParamsError, InvalidTokenError, QuickbooksOnlineSDKError, \ | |||
NoPrivilegeError, NotFoundItemError, ExpiredTokenError, InternalServerError | |||
|
|||
import logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to top
qbosdk/apis/api_base.py
Outdated
@@ -9,6 +9,11 @@ | |||
from ..exceptions import WrongParamsError, InvalidTokenError, QuickbooksOnlineSDKError, \ | |||
NoPrivilegeError, NotFoundItemError, ExpiredTokenError, InternalServerError | |||
|
|||
import logging | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls bump version as well
qbosdk/apis/api_base.py
Outdated
@@ -118,11 +117,14 @@ def _query_get_all_generator(self, object_type: str, url: str) -> Generator[Dict | |||
if not query_response or object_type not in query_response: | |||
break | |||
|
|||
logger.debug('Response for get request for url: %s, %s', url, query_response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print response.text - I don't want any data to be missed
qbosdk/apis/api_base.py
Outdated
except requests.exceptions.HTTPError as err: | ||
logger.info('Response for get request for url: %s, %s', url, err.response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err.response.text
qbosdk/apis/api_base.py
Outdated
@@ -242,19 +248,19 @@ def _post_request(self, data, api_url): | |||
'Authorization': 'Bearer {0}'.format(self.__access_token) | |||
} | |||
|
|||
logger.debug('Payload for post request: %s', data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's log this as well
@@ -259,7 +259,7 @@ def _post_request(self, data, api_url): | |||
result = json.loads(response.text) | |||
return result | |||
|
|||
logger.info('Payload for post request: %s', data) | |||
logger.debug('Payload for post request: %s', data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be before 257 block, we don't end up reaching here since we're returning at 260
No description provided.