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
Documentation falsely leads to believe that MemoryHandler can be used to wrap SMTPHandler to send multiple messages per email #77116
Comments
In the handlers documentation, MemoryHandler directly follows SMTPHandler. SMTPHandler does not document that it is sending an email per every logging invocation, but one can sort of guess it. Right afterwards, there is the documentation of MemoryHandler, which seems to hint that one can use it to buffer up log lines and send all of them with SMTPHandler at flush time, by using it as a target. What really happens when trying to do that, is that at flush time an email per buffered log line is sent instead. It would have saved me significant time and frustration if I had found in SMTPHandler a note saynig that in order to buffer up all log messages and send them as a single email, one needs to reimplement BufferingHandler and all the email composition/sending logic, and the existing handlers provide no build-in facility for doing that. |
The documentation does talk about emit() operating on single records: https://docs.python.org/3/library/logging.handlers.html#logging.handlers.BufferingHandler.emit How would you make this clearer? |
…onGH-96324) (cherry picked from commit 43a6dea) Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
…onGH-96324) (cherry picked from commit 43a6dea) Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: