Debugging

Why you should think twice before using awesome_print (and similar) in production

Filed under: Ruby & Rails
awesome_print-ruby-gem-performance-killer.png

We've seen in the previous posts how the awesome_print Ruby gem can be used to prettify also application logs, to make their content more readable. It may sound like a good idea, but you're warned: it can kill performance.

Read more »

A few more methods to format and beautify Ruby objects in console and logs

Filed under: Ruby & Rails
beautify-code.png

Follow up to the previous post, with a few more ways to format and beautify output in a Ruby console as well as in application logs.

Read more »

Prettier, user friendly printing of Ruby objects

Filed under: Ruby & Rails
awesome_print-ruby.png

If you, like me, don't like too much how Ruby objects usually look when displayed in a console (output on single lines, lack of indentation, and so on), it's likely you also have looked for ways to prettify this kind of output. This can be useful in a console, but also to have more user friendly, more readable debugging information in your application’s log files. Not only: as we'll see, knowing which 'printer' methods to use for each case can help display or log more complete information about your Ruby objects.

Read more »