Caller's module name, function/method name and line number for output to logging

Malcolm Greene python at bdurham.com
Mon Jul 25 18:40:29 EDT 2016


Hi Terry,

>> Is there a technique for accessing a function's *CALLER* module name,
>> function/method name and line number so that this information can be

> Look in the inspect module for the inspect stack function.  Note that 
> when you call the function, it needs to look 2 levels up.

Perfect! That's exactly what I was looking for.

Thank you,
Malcolm



More information about the Python-list mailing list