Last Updated: February 25, 2016
·
1.111K
· cwninja

Backtrace on demand

Put this in your app (a rails initialiser works well), and then hit ctrl+t to produce a backtrace of your running app, without stopping it!

trap('INFO') do
  puts "\n\n#{Process.pid} - #{Thread.current.object_id}"
  puts caller.join("\n")
  puts "\n\n"
end

Never again ask yourself WTF is this piece of shit doing?!?