faithfulgeek (owner)

Revisions

  • a46359 Wed Dec 17 14:29:05 -0800 2008
  • 3cb532 Wed Dec 17 14:19:18 -0800 2008
gist: 37265 Download_button fork
public
Public Clone URL: git://gist.github.com/37265.git
Embed All Files: show embed
colorize_logger_output.rb #
1
2
3
4
5
6
7
8
9
# Add this as an initializer or to environments/development.rb for nicer logger output (thanks epitron for helping with this idea)
# Usage: logger.red "Blah"
# Shows messages in your log with a red background and bold, white text
class ActiveSupport::BufferedLogger
  def red(m)
    emphasized = "\e[1;1m\e[41m #{m} \e[0m"
    debug(emphasized)
  end
end