lib/rack/insight/panels/log_panel.rb in rack-insight-0.5.13 vs lib/rack/insight/panels/log_panel.rb in rack-insight-0.5.14

- old
+ new

@@ -20,46 +20,27 @@ log_level = args[0] store(@env, LogEntry.new(log_level, timing.delta_t, message)) end def initialize(app) - probe(self) do - if !Rack::Insight::Config.config[:panel_configs][:log_panel].respond_to?(:[]) + + # Call super before setting up probes in case there are any custom probes configured + super # will setup custom probes + + unless is_probed? + probe(self) do # Trying to be smart... if defined?(ActiveSupport) instrument "ActiveSupport::BufferedLogger" do instance_probe :add end else instrument "Logger" do instance_probe :add end end - else - # User has explicitly declared what log classes to monitor: - # Rack::Insight::Config.configure do |config| - # config[:panel_configs][:log_panel] = {:watch => {'Logger' => :add}} - # end - Rack::Insight::Config.config[:panel_configs][:log_panel][:watch].each do |klass, method_probe| - instrument klass do - instance_probe method_probe - end - end end end - - table_setup("log_entries") - - super - end - - def name - "log" - end - - def heading_for_request(number) - num = count(number) - "Logs (#{num})" end def content_for_request(number) render_template "panels/log", :logs => retrieve(number) end