[New-bugs-announce] [issue18671] enhance formatting in logging package

M. Dietrich report at bugs.python.org
Tue Aug 6 17:57:49 CEST 2013


New submission from M. Dietrich:

in logging/__init__.py line 328 there is a simple line:

     msg = msg % self.args

if that line fails this failure will be logged, not the line itself. i suggest to change the line to something like:

    try: msg = msg % self.args
    except TypeError: msg = 'logging formatting error with "%s" %% %s' % (
        msg, self.args, )

to be able to pinpoint the actual wrong formatting string (the stack trace doesnt help here).

----------
components: Extension Modules
messages: 194559
nosy: mdt
priority: normal
severity: normal
status: open
title: enhance formatting in logging package
type: enhancement

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


More information about the New-bugs-announce mailing list