473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

some kind of trace facility ?

hello,

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 time)
- 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 ?

thanks,
Stef Mientki

Aug 9 '08 #1
2 904
Stef Mientki schrieb:
hello,

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 time)
- 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 ?
THere is the module profile and the sys.trace-hook.

Diez
Aug 10 '08 #2
On Aug 10, 1:14*am, Stef Mientki <stef.mien...@gmail.comwrote:
hello,

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 time)
- 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 ?

thanks,
Stef Mientki
I second the suggestion of using a custom decorator.
Also, look at the facilities provided by the
inspect module, at sys._getframe() and similar
things. Looking at the introspection tricks used
in the source code of the
decorator module may be of help:

http://www.phyast.pitt.edu/~micheles...mentation.html
Aug 10 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ashish | last post by:
Hello, Is there a way to print stack trace in a c++ application? I would like to do this before asserting in a situation that can't be handled. Thanks, -Ashish
9
by: GDCII | last post by:
Does anyone know what the DB2 equivalent is for Oracle:Trace or SQl Server Profiler ? Thanks Gary
1
by: Stu | last post by:
Can somebody please explain what the facility paramter is in the openlog() system call. void openlog(const char *ident, int logopt, int facility); The solaris man page says this: The...
0
by: Henry | last post by:
Dear Group: In testing web applicaiton with trace enabled, I noticed that the content of the trace.axd is reset/cleared automatically on every application restart. Can someone advice if that is...
2
by: GMK | last post by:
HI ALL I'M COMING FROM A FOX PRO BACKGROUND WHERE I COULD IN A VERY EASY WAY CREATE A SEACH FACILITY BY PRESSING N F1 AND ANOTHER WINDOW WILL DIRECTLY APPEAR WHICH WOULD LET THE USER TO SEARCH...
5
by: vsr | last post by:
is there any way to remove some information from trace, tracing by default displays session , application variables, but i need to remove these two from trace.can any let me know how can i do it?
1
by: aimslife | last post by:
Hi, I created simple DLL project using vs2k5. I need to print debug statements in ouput window during debug mode. I tried to use TRACE macro in project and include windows.h header file but...
8
by: nospam | last post by:
I have a C binary which is built from numerous .c and .h source files. How can I trace through which functions are being called when I execute the binary? Ideally I'd like to just see the function...
0
by: Timothy Grant | last post by:
n Sat, Aug 9, 2008 at 4:14 PM, Stef Mientki <stef.mientki@gmail.comwrote: As is often the case, I have never used this technique, but have read about it: You may want to investigate a logging...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.