One of the ways I prefer to debug is to print things to standard out and watch a console window. The problem is, in Rails, I get a lot of spam to sift through that I usually don’t need: SQL statements, routing and rendering info, etc. It makes finding your output difficult. Today I came up with this convenience method, which makes all of my output a nice orangish/yellow color thats easy to pick out.

  1. def ppp (obj)
  2.   puts "\e[33m#{obj.pretty_inspect}\e[0m"
  3. end

Below is a partial screenshot of what my output looks like. Everything I output with the ppp method is very easy to see.

Not especially clever or brilliant, but I find it really helpful.