[New-bugs-announce] [issue32935] Documentation falsely leads to believe that MemoryHandler can be used to wrap SMTPHandler to send multiple messages per email

Enrico Zini report at bugs.python.org
Sat Feb 24 05:31:19 EST 2018


New submission from Enrico Zini <enrico at enricozini.org>:

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.

----------
components: Library (Lib)
messages: 312710
nosy: enrico
priority: normal
severity: normal
status: open
title: Documentation falsely leads to believe that MemoryHandler can be used to wrap SMTPHandler to send multiple messages per email
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32935>
_______________________________________


More information about the New-bugs-announce mailing list