Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
How to write a custom tracer/profiler?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="AK@SYD, post: 3589202"] Hi, all, Just wanna look for some suggestions on how to appoarch this problem... I have some code ("main logic") which has a dependency on a library. Let's call it DS. ("data source"). The main logic will issue a number of calls to the DS in order to get the data it needs and then carry out some calculations. I want to have a non-intrusive way to find out all the DS data requested by the main logic. One thing to note, the DS is a big, messy bit of code. So putting logger everywhere within DS and main logic is not a reliably, satisfactory solution. I have thought about using somehting like aspect. But seems to me there is no mature, widely-used aspect lib out there. Another idea is: let's roll a custom tracer/profiler. Whenever any method/attributes in the DS package are called, the return values will be logged. I have taken a quick look at profile.py in python 2.4, It seems sys module will pass a frames to the profile class. Can I access the return value of a function via these frame objects? Cheers, Anthony [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
How to write a custom tracer/profiler?
Top