-
-
Notifications
You must be signed in to change notification settings - Fork 456
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
Window size config #1975
base: master
Are you sure you want to change the base?
Window size config #1975
Changes from all commits
36c27d5
65fee54
c3be359
7ba2f03
2f4d3d9
c5fa92e
7710133
3001910
e4bb2ec
12ee566
c021795
1c4590b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,22 +10,27 @@ Add the following to your code to log everything available: | |
|
||
import logging | ||
|
||
handler = logging.StreamHandler() | ||
handler.setLevel(logging.DEBUG) | ||
stream_handler = logging.StreamHandler() | ||
stream_handler.setLevel(logging.DEBUG) | ||
file_handler = logging.handlers.RotatingFileHandler( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might be too advanced. Maybe add a second example explaining why you recommend a rotating file handler. |
||
"praw_log.txt", maxBytes=1024 * 1024 * 16, backupCount=5 | ||
) | ||
file_handler.setLevel(logging.DEBUG) | ||
for logger_name in ("praw", "prawcore"): | ||
logger = logging.getLogger(logger_name) | ||
logger.setLevel(logging.DEBUG) | ||
logger.addHandler(handler) | ||
logger.addHandler(stream_handler) | ||
logger.addHandler(file_handler) | ||
|
||
When properly configured, HTTP requests that are issued should produce output similar to | ||
the following: | ||
|
||
.. code-block:: text | ||
|
||
Fetching: GET https://oauth.reddit.com/api/v1/me | ||
Fetching: GET https://oauth.reddit.com/api/v1/me at 1691743155.4952002 | ||
Data: None | ||
Params: {'raw_json': 1} | ||
Response: 200 (876 bytes) | ||
Response: 200 (876 bytes) (rst-45:rem-892:used-104 ratelimit) at 1691743156.3847592 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this is from prawcore but what do you think about changing the epoch to a timestamp? It would only be 1 or 2 more characters and would be human readable. |
||
|
||
Furthermore, any API ratelimits from POST actions that are handled will produce a log | ||
entry with a message similar to the following message: | ||
|
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.
I think this should be in a different section. This section is for configuring PRAW with a custom Reddit instance.