-
Notifications
You must be signed in to change notification settings - Fork 24
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
Rate Limit Countdown for the API Module #137
base: master
Are you sure you want to change the base?
Conversation
Added the staticmethod rate_limit_countdown.
Changed rate_limit_countdown timer to minutes instead of seconds.
Updated the Rate Limit Countdown function to display in minutes remaining and not seconds remaining.
Reworded display message for the function rate_limit_countdown
Cloud you change the |
I can change the print statement to console log messages. I noted that you aren't really using logging in your package. I would have to add this to
The output would look like this:
Is this what you want? P.S. I updated the code linked to my pull request to send the information to the console using logging. |
Updated countdown to use logging.
this library should not change the |
This pull request has gotten off track with trying to use logging as you requested. According to Python 3.x official documentation for logging the best way to "Display console output for ordinary usage of a command line script or program" is using These print statements would provide the user clear feedback about the rate limit threshold status and the time to reset this threshold. This is what the user would see:
If we use logging then the user would get useless data, such the asctime, name of the module and the log type. This is what the user would see:
To accomplish the latter the logging code within |
Yes, you are right. But the users need to control whether to display logs outside the library. If you use |
Can you please provide me an example on how users are controlling logging while using FYI The reason that I created this pull request was to get some visual feedback when I could potentially add the switch 'notify_on_rate_limit
I'm updated the code linked to my pull request to use the param notify_on_rate_limit. I have also tested the code and it works. |
updated this module with the parameter `notify_on_rate_limit`
Updated code to include the param `notify_on_rate_limit`
This parameter the For example
In another file
Then,the log will displayed.
|
Personally, I would except a Python Package, such as yours to have logging enabled by default and written out to a YAML file. Also how would a user know what items that you are logging without looking at the code? And you are currently only logging twice in the entire code base. I know this because I looked at the code.
The parameter
Your logging way requires the user TO KNOW that a notification exists in the code and that they have to wrap extra code around the API to see this notification. |
Created a static method to provide a visual countdown in minutes remaining when a rate limit threshold has been reached.
UPDATED this request on 04.29.2023 with new code.