From: Richard Date: 2006-11-28T11:40:05+09:00 Subject: Re: Is there a simply way to get every method log itself before running? Hi Hermant, I liked Phrogz's suggestion about using set_trace_func/, which I'm going to study. But right now I think Needle will get me going faster. So I'm going to work on that first. Thank you for taking the time to post a message about it. I'm going to be applying this in a Rails application, so I've got to figure out where the top level of the generated app is, but I think I'll be able to figure it out. Best wishes, Richard hemant wrote: > On 11/25/06, Phrogz wrote: > > Richard wrote: > > > As a Ruby nubie, every once-in-a-while I'd like to write a trace > > > function and have every method execute that trace when the method's > > > invoked. In that trace function, I'd like to be able, e.g. to write > > > the invoked method's name, perhaps more. > > > > I believe the answer to your question (though I've not done it myself) > > lies in set_trace_func > > http://phrogz.net/ProgrammingRuby/ref_m_kernel.html#Kernel.set_trace_func > > > > Which links to an example in: > > http://phrogz.net/ProgrammingRuby/ospace.html#tracingyourprogramsexecution > > > > > > > > Goodness, you need needle. > > Get it from here: > > http://needle.rubyforge.org/chapter-1.html > > > -- > There was only one Road; that it was like a great river: its springs > were at every doorstep, and every path was its tributary.