[Yum-devel] Logging bug (yum or python)

Mihai Ibanescu misa+yum at redhat.com
Mon Jul 17 17:52:42 UTC 2006


On Mon, Jul 17, 2006 at 11:34:51AM -0400, James Bowes wrote:
> Mihai Ibanescu wrote:
> >Hello,
> >
> >This logging bug landed in the python component:
> >
> >https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=198971
> >
> >If someone can produce a test case outside of yum (I don't have a rawhide
> >machine handy right now), please let me know.
> >
> 
> FYI, the bug now has a test case attached for outside of yum that 
> reproduces the problem for me on FC5.

Well, it's a test case for "INFO".lower() != "info".
Here's a test case for exhibiting the problem in python's logging library
(attached).

This works:
python /tmp/logging-broken.py

This doesn't:

LANG=tr_TR.UTF-8 python /tmp/logging-broken.py

Looks like it has to be the syslog handler, otherwise it won't attempt to
display the priority.

Misa
-------------- next part --------------
import sys
import logging
import logging.handlers
import locale

locale.setlocale(locale.LC_ALL, "")

plainformatter = logging.Formatter("%(message)s")

handler = logging.handlers.SysLogHandler('/dev/log')
handler.setFormatter(plainformatter)

logger = logging.getLogger("a.b.c")
logger.setLevel(logging.INFO)
logger.propagate = False
logger.addHandler(handler)

logger.info("Bwahahaha")


More information about the Yum-devel mailing list