classification
Title: logging: formatter does not accept %(funcName)s properly
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: CM, vinay.sajip
Priority: normal Keywords:

Created on 2007-09-24 14:20 by CM, last changed 2007-09-25 22:42 by vinay.sajip. This issue is now closed.

Messages (2)
msg56111 - (view) Author: Christian Meesters (CM) Date: 2007-09-24 14:27
Adding %(funcName)s to a formatter will only insert the calling logging
function (e.g. "info" for logging.info) into messages not the function
where the message comes from:

<snip>
logging.Formatter('%(levelname)-8s %(funcName)s %(message)s'

def foo():
    logging.info("test")

will insert

'INFO    info test'

in the log instead of 

'INFO    foo test'
msg56141 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2007-09-25 22:42
This is not a logging bug, but related to #1180193.

See http://bugs.python.org/issue1180193
History
Date User Action Args
2007-09-25 22:42:34vinay.sajipsetstatus: open -> closed
assignee: vinay.sajip
resolution: duplicate
messages: + msg56141
nosy: + vinay.sajip
2007-09-24 17:18:10jafosetpriority: normal
2007-09-24 14:27:30CMsetnosy: + CM
messages: + msg56111
2007-09-24 14:20:12CMcreate