How can I colorize and possibly bold the output from Rails.logger in my rails3 application?
A:
http://stackoverflow.com/questions/1286001/how-do-i-tell-activerecord-not-to-log-any-control-chars
just do the opposite, for active record
also see this link
http://joefiorini.com/post/64995867/coloring-in-the-rails-log-and-console
Aaron Saunders
2010-08-06 03:05:21
+1
A:
Be kind to other programmers, don't embed the escape sequences directly in your strings. Maybe use a library like Rainbow or Term-ANSIColor? Eg Term-ANSIColor:
require 'term/ansicolor'
include Term::ANSIColor
Rails.logger.add 1, "#{red(ATCHUNG!)}: pay attention to me!"
jdeseno
2010-08-06 03:20:13