some kind of trace facility ?
timothy.grant at gmail.com
Sun Aug 10 07:38:34 CEST 2008
n Sat, Aug 9, 2008 at 4:14 PM, Stef Mientki <stef.mientki at gmail.com> wrote:
> I want to investigate on a regular base the flow of my Python (most of them
> using wxPython) programs.
> So I want to have some log facilty, that logs things like
> - every time a function / method is called
> - the time spent in that function / method (or even better start / finish
> - in case the function / method has some predefined variables, the values of
> these variables
> - the caller
> As an extra condition, I'm only interested in my own program modules
> (located in a specific subdirectory).
> Is there a module available that can perform such a task ?
> Any hints to get started ?
> Stef Mientki
As is often the case, I have never used this technique, but have read about it:
You may want to investigate a logging decorator. Python's Decorator
module has a decorator factory that should allow you to log at least
the calls. I'm not sure it would help you much with the time the
method took, but I could very well be wrong about that.
tjg. [Timothy Grant]
More information about the Python-list