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

2014-05-29 Thread Bikram Zesto II

New submission from Bikram Zesto II:

HTTPHandler instance will assign a Formatter to format() but emit() never calls 
self.format(record) so it has no effect. I know mapLogRecord() does something 
like this now but would like to reuse Formatters across Handlers instead of 
subclassing HTTPHandler just for HTTP logging.

Does it make sense to assign mapLogRecord by default to self.format but allow 
it to be over-ridden like other Handlers?

--
components: Library (Lib)
messages: 219365
nosy: bk2zsto
priority: normal
severity: normal
status: open
title: logging.handlers.HTTPHandler.setFormatter() has no effect
type: behavior
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue21608>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-05-30 Thread Bikram Zesto II

Bikram Zesto II added the comment:

I see what you are saying about implementation kludginess and will likely 
subclass just to get my app done.

On the other hand, I think the POLA(stonishment) violation of ignoring 
format-related configuration of the Handler (even tho it is a subclass) matters 
too :-)

Was not thinking a Formatter should be put _into_ mapLogRecord. More like idly 
wondering if mapLogRecord could be implemented as a Formatter. If this sounds 
like a non-kludge you would be interested in I can work on that. Added benefit 
being that users could override without subclassing.

Maybe this is more like a documentation issue (since there is no indication 
that HTTPHandler does not/cannot use a Formatter like other of Handlers?

--
keywords: +patch
status: pending -> open
Added file: http://bugs.python.org/file35410/logging.handlers.txt.patch

___
Python tracker 
<http://bugs.python.org/issue21608>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com