Class: ActiveSupport::BufferedLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/adapters/logger.rb

Constant Summary collapse

@@severity_reverse_hash =
{0 => "DEBUG", 1 => "INFO", 2 => "WARN", 3 => "ERROR", 4 => "FATAL", 5 => "UNKNOWN"}

Instance Method Summary collapse

Instance Method Details

#add_with_notify(severity, message = nil, progname = nil, &block) ⇒ Object



5
6
7
8
9
10
# File 'lib/adapters/logger.rb', line 5

def add_with_notify(severity, message = nil, progname = nil, &block)
  add_without_notify(severity, message, progname, &block)
  if severity > Severity::INFO
    `notify-send --icon="#{File.dirname(__FILE__)}/../resources/warn.png" "Rails logger #{@@severity_reverse_hash[severity]}", "#{message}"`
  end
end