Topic: Tool to trace calls at runtime

Hello Everyone,

I have inherited a 2 year old rails 2.3.10 app and have to perform minor bug fixes on it from time to time.  Wondering if anyone knows of a way/tool to trace method calls and such through the app? I have set the log level to debug but all I get is more and more sql -- what I want  are the classes/methods that generate the sql .   

Any other useful tools or methodologies for my situation would also be helpful. 

Thanks.

blog: ridingwithrails.wordpress.com
twtr: http://twitter.com/ridingwithrails

Re: Tool to trace calls at runtime

I don't think it exists. Depending on how the application was written, you can have query executed from everywhere even if logically it should be done in models. More of that, you want to trace methods calls. Do you imagine the number of the calls. It could be very-very greate depending on the complexity of the business logic and number of connection to the application?
I think, the simplest way is:
- look and check the application routes to have an idea how the things arer 'routed' and linked together
- just investigate the log file
- in case of problems, debug the code

Last edited by Javix (2011-06-09 03:10:25)

Re: Tool to trace calls at runtime

To follow up on this.  After some going through several tools I settled on RubyMine.  It has an excellent debugger which allowed me to stick breakpoints in and figure out what is going on.

blog: ridingwithrails.wordpress.com
twtr: http://twitter.com/ridingwithrails

Re: Tool to trace calls at runtime

I would follow that..

Re: Tool to trace calls at runtime

You might be interested in pry which is useful for debugging ruby code:

http://rubygems.org/gems/pry

Re: Tool to trace calls at runtime

thanks..! very useful



Mobile Website Australia, mobile websites, mobile website design

Last edited by vanhellsing (2012-03-23 10:16:42)