[issue21608] logging.handlers.HTTPHandler.setFormatter() has no effect

Vinay Sajip report at bugs.python.org
Fri May 30 18:29:55 CEST 2014


Vinay Sajip added the comment:

As far as POLA is concerned, IMO serializing to the HTTP request format isn't really a text formatting operation in the same way as for most other handlers. The point is, even if you could have a Formatter handle the operation, you can't usefully share this Formatter with other handlers (which you refer to in your initial post), unless you really want to have format lines such as a=b&c=d&e=f output to console or file, say - which is unlikely to be a common requirement.

I don't expect to make any changes in this area - as I mentioned earlier, because (a) backward compatibility and (b) IMO it will surprise more people than the current approach (IIRC no one else has raised this or a similar issue in the 10+ years that logging has been in Python).

BTW, I am happy to update the documentation for HTTPHandler to indicate that it can't sensibly use a Formatter. I'll do this soon, and that change will close this issue.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21608>
_______________________________________


More information about the Python-bugs-list mailing list