This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: logging: log actual function name
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.0
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: umaxx, vinay.sajip
Priority: low Keywords:

Created on 2007-12-30 14:31 by umaxx, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg59042 - (view) Author: (umaxx) Date: 2007-12-30 14:31
logging does not have a (formatter) option for logging the actual
function name

Logger class detects function name with findCaller() - *but* does not
pass it to the makeRecord()-call in _log() - why?

would be nice to see this feature implemented, no patch for now :(
msg59090 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2008-01-02 06:44
This must be some kind of SVN issue. Works fine on 2.5.1:

Python 2.5.1 (r251:54863, May  2 2007, 16:56:35) 
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> def myLoggingFunc():
...     logging.warning("Be warned!")
... 
>>> logging.basicConfig(format="%(funcName)s %(message)s")
>>> myLoggingFunc()
myLoggingFunc Be warned!
>>>
msg59091 - (view) Author: (umaxx) Date: 2008-01-02 09:34
oops... i looked at python 2.4, not the latest trunk. my fault :(
please close this issue.

sorry for the noise...
History
Date User Action Args
2022-04-11 14:56:29adminsetgithub: 46050
2008-01-02 12:45:21vinay.sajipsetstatus: pending -> closed
2008-01-02 09:34:52umaxxsetmessages: + msg59091
2008-01-02 06:44:30vinay.sajipsetstatus: open -> pending
resolution: not a bug
messages: + msg59090
2008-01-02 03:03:48gvanrossumsetpriority: low
assignee: vinay.sajip
nosy: + vinay.sajip
2007-12-30 14:31:23umaxxcreate