Reputation: 3328
How can I colorize and possibly bold the output from Rails.logger in my rails3 application?
Upvotes: 3
Views: 2733
Reputation:
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!"
Upvotes: 7
Reputation: 33345
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
Upvotes: 0