Tuesday, November 12, 2019

Ruby and Rails tracing

To trace execution in a Ruby/Rails application add the following -


t = TracePoint.new(:line) do |tp|  
p "#{tp.path}:#{tp.defined_class}:#{tp.method_id}:#{tp.lineno}"
end
t.disable