logging module - how to include method's class name when using %(funcName)

Malcolm Greene python at bdurham.com
Mon Sep 10 21:43:36 EDT 2018


I'm using the Python logging module and looking for a way to include a
method's class name when using %(funcName). Is this possible? When you
have several related classes, just getting the function (method) name is
not enough information to provide context on the code being executed.
I'm outputting module name and line number so I can always go back and
double check a caller's location in source, but that seems like an
archaic way to find this type of information.
Thank you,
Malcolm



More information about the Python-list mailing list