[ python-Bugs-1470422 ] Logging doesn't report the correct filename or line numbers

SourceForge.net noreply at sourceforge.net
Fri Apr 14 17:48:48 CEST 2006


Bugs item #1470422, was opened at 2006-04-14 11:48
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1470422&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Tsai (michaeltsai)
Assigned to: Nobody/Anonymous (nobody)
Summary: Logging doesn't report the correct filename or line numbers

Initial Comment:
I have a logger that prints out %(filename)s:%(lineno)d along with the 
message. Instead of printing the file and line in my code where I call the 
logger, it prints out a location in logging/__init__.py.

I was able to fix this, at least for my purposes, by changing 
logging.currentframe from sys._getframe to lambda:sys._getframe(3).


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1470422&group_id=5470


More information about the Python-bugs-list mailing list