[issue16778] Logger.findCaller needs to be smarter

Glynn Clements report at bugs.python.org
Thu Dec 27 03:37:36 CET 2012


Glynn Clements added the comment:

Subclassing findCaller() is likely to be a bit hairy for the average user, as it deals with some fairly arcane aspects of Python internals.

As for mechanism, maybe allow functions/methods to be registered with the logging module, which would store a referenceto the function's func_code member. findCaller() would check the frame's f_code member against the set of registered functions, and continue up the stack until it found an unregistered function.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16778>
_______________________________________


More information about the Python-bugs-list mailing list