Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

david reese http://whatcould.com

1 total

Log a backtrace in rails

If you're in a tough spot, debugging-wise, in your rails app, you can log your entire backtrace to see who called whom. Just put this snippet in the troublesome spot:

      begin
        raise "boom"
      rescue => detail
        RAILS_DEFAULT_LOGGER.info detail.backtrace.join("\n")
      end
1 total