strange behavious of the logging module?

Peter Otten __peter__ at web.de
Mon Sep 24 11:29:27 EDT 2007


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.

Peter



More information about the Python-list mailing list