Class: Logbang::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/logbang/railtie.rb

Class Method Summary collapse

Class Method Details

.log(message) ⇒ Object

Writes the log string out to the Rails logger in a pretty yellow colour that is almost impossible to miss!



9
10
11
12
13
14
15
16
17
# File 'lib/logbang/railtie.rb', line 9

def self.log(message)
  out = ""
  out << ActiveSupport::LogSubscriber::YELLOW
  out << ActiveSupport::LogSubscriber::BOLD
  out << " = "
  out << message
  out << ActiveSupport::LogSubscriber::CLEAR
  Rails.logger.info out
end