-
Notifications
You must be signed in to change notification settings - Fork 28
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
#28: Add session history to ease request debugging #47
base: develop
Are you sure you want to change the base?
Conversation
ajjn
commented
Mar 8, 2020
- To address issue Debug printing the raw json data #28.
README.rst
Outdated
enable_history_at_loglevel='WARNING') | ||
# or | ||
import logging | ||
logging.basicConfig(level='DEBUG') |
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.
Are you sure it's a good idea to tie the library to a logging library this way ? What if I want to use some other logging library ? Or if I want to debug in production but don't want to leak this data to eg. sentry via sentry-sdk breadcrumbs or data logging ? I think this is something that should instead be explicitly set, so eg. enable_session_log: bool instead of enable_history_at_loglevel.
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.
Also, it might be a better idea to allow function callback hooks for this. Eg. hook for received data, hook for sent data etc. That would be much more versatile, and also allows for 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.
Thanks @katajakasa, I guess you are right! The library user can anyway build whatever logic for binding to log level the way they want, so I will just make it a simple boolean enabled. Adding callback hooks is also a good idea. Let's see what can be done...