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

2016-07-26 Thread Malcolm Greene
Hi Peter, > Fine! Then you can avoid the evil hack I came up with many moons ago: > https://mail.python.org/pipermail/python-list/2010-March/570941.html Evil? Damn evil! Love it! Thank you, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

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

2016-07-25 Thread Peter Otten
Malcolm Greene wrote: > 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 need

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

2016-07-25 Thread Malcolm Greene
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!

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

2016-07-25 Thread Terry Reedy
On 7/25/2016 3:16 PM, Malcolm Greene wrote: 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 l