Skip to content

Instantly share code, notes, and snippets.

@codeincontext
Created April 4, 2012 09:33
Show Gist options
  • Save codeincontext/2299966 to your computer and use it in GitHub Desktop.
Save codeincontext/2299966 to your computer and use it in GitHub Desktop.
Show logger.debug lines in green in the Rails development log
config.after_initialize do
class<<Rails.logger
def debug_with_color(message)
message_color = "0;32;1"
colored_message = "\e[#{message_color}m#{message}\e[0m"
debug_without_color(colored_message)
end
alias_method_chain :debug, :color
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment