strange behavious of the logging module?

Vinay Sajip vinay_sajip at yahoo.co.uk
Mon Sep 24 18:29:38 EDT 2007


On Sep 24, 4:29 pm, Peter Otten <__pete... at web.de> wrote:
> Vinay Sajip wrote:
> > On Sep 24, 8:03 am, Peter Otten <__pete... at web.de> wrote:
>
> >> It would still be a good idea to file a bug report.
>
> > Not sure where the bug is. The script below, when called, prints
> > "Information" to the console and "INFO     some_func Information" to
> > mc_rigid.log, as I would expect. (Python 2.5.1)
>
> I get
>
> $ python vinaj.py
> Information
> $ cat mc_rigid.log
> INFO     info     Information
>
> Maybe a platform issue (I'm on Ubuntu 7.04)?
>
> It seems Logger.findCaller() gets puzzled by the following discrepancy:
>
> >>>logging.info.func_code.co_filename
>
> 'logging/__init__.py'>>>logging._srcfile
>
> '/usr/lib/python2.5/logging/__init__.py'
>
> I don't think I have messed with paths manually on that machine, by the
> way.
>

This is a known bug, and not specifically related to logging, though
it sometimes manifests itself via logging:

http://bugs.python.org/issue1180193

Regards,

Vinay




More information about the Python-list mailing list