lib/rack/insight/panel.rb in rack-insight-0.5.20 vs lib/rack/insight/panel.rb in rack-insight-0.5.21

- old
+ new

@@ -244,13 +244,15 @@ heading end end rescue Object => ex nom = self.name rescue "xxx" -"Err3: #{nom} - Panel: #{self.inspect} - #{([ex.class.name, ex.message] + ex.backtrace).join("<br/>")}" + msg = ["Failed to create heading_for_request for #{nom}","#{ex.class}: #{ex.message}"] + ex.backtrace + logger.error(msg.join("\n")) + "Err3: #{nom} + <!-- Panel: #{self.inspect}\n + #{msg.join("\n")} -->" end def content_for_request(number) logger.info("Rack::Insight is using default content_for_request for #{self.class}") if verbose(:med) if !self.has_table? @@ -268,31 +270,37 @@ else content end rescue Object => ex nom = self.name rescue "xxx" -"Err4: #{nom} - Panel: #{self.inspect} - #{([ex.class.name, ex.message] + ex.backtrace).join("<br/>")}" + msg = ["Failed to create content_for_request for #{nom}","#{ex.class}: #{ex.message}"] + ex.backtrace + logger.error(msg.join("\n")) + "Err4: #{nom} + <!-- Panel: #{self.inspect}\n + #{msg.join("\n")} -->" end def heading self.camelized_name rescue Object => ex nom = self.name rescue "xxx" -"Err1: #{nom} - Panel: #{self.inspect} - #{([ex.class.name, ex.message] + ex.backtrace).join("<br/>")}" + msg = ["Failed to create heading for #{nom}","#{ex.class}: #{ex.message}"] + ex.backtrace + logger.error(msg.join("\n")) + "Err1: #{nom} + <!-- Panel: #{self.inspect}\n + #{msg.join("\n")} -->" end def content logger.info("Rack::Insight is using default content for #{self.class}") if verbose(:med) render_template 'no_content', :name => self.camelized_name rescue Object => ex nom = self.name rescue "xxx" -"Err2: #{nom} - Panel: #{self.inspect} - #{([ex.class.name, ex.message] + ex.backtrace).join("<br/>")}" + msg = ["Failed to create content for #{nom}","#{ex.class}: #{ex.message}"] + ex.backtrace + logger.error(msg.join("\n")) + "Err2: #{nom} + <!-- Panel: #{self.inspect}\n + #{msg.join("\n")} -->" end # Override in subclasses. # This is to make magic classes work. def after_detect(method_call, timing, args, result)