[New-bugs-announce] [issue16778] Logger.findCaller needs to be smarter
report at bugs.python.org
Tue Dec 25 17:20:28 CET 2012
New submission from Glynn Clements:
The current behaviour of logging.Logger.findCaller() makes it awkward to add custom logging interfaces.
E.g. suppose that you define a custom logging level (NOTICE) then add a notice() function (analogous to logging.info() etc), the resulting LogRecord structure will have pathname, filename, module, funcName and lineno members which refer to the notice() function itself, rather than to its caller.
This can be hacked around e.g. by using code.compile_command to lie about the source filename, but that's ugly and highly unintuitive.
components: Library (Lib)
title: Logger.findCaller needs to be smarter
versions: Python 2.7
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce