Module: Rack::Bug::LoggerExtension

Defined in:
lib/rack/bug/panels/log_panel/logger_extension.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(target) ⇒ Object



2
3
4
5
# File 'lib/rack/bug/panels/log_panel/logger_extension.rb', line 2

def self.included(target)
  target.send :alias_method, :add_without_rack_bug, :add
  target.send :alias_method, :add, :add_with_rack_bug
end

Instance Method Details

#add_with_rack_bug(*args, &block) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/rack/bug/panels/log_panel/logger_extension.rb', line 7

def add_with_rack_bug(*args, &block)
  logger_return = add_without_rack_bug(*args, &block)
  logged_message = logger_return
  logged_message = args[1] || args[2] unless logged_message.is_a?(String)
  Rack::Bug::LogPanel.record(logged_message, args[0])
  return logger_return
end