lib/prosopite.rb in prosopite-1.2.2 vs lib/prosopite.rb in prosopite-1.3.0

- old
+ new

@@ -10,18 +10,23 @@ :prosopite_logger, :custom_logger, :allow_stack_paths, :ignore_queries, :ignore_pauses, - :min_n_queries + :min_n_queries, + :backtrace_cleaner def allow_list=(value) puts "Prosopite.allow_list= is deprecated. Use Prosopite.allow_stack_paths= instead." self.allow_stack_paths = value end + def backtrace_cleaner + @backtrace_cleaner ||= Rails.backtrace_cleaner + end + def scan tc[:prosopite_scan] ||= false return if scan? subscribe @@ -191,14 +196,18 @@ notifications_str = '' tc[:prosopite_notifications].each do |queries, kaller| notifications_str << "N+1 queries detected:\n" + queries.each { |q| notifications_str << " #{q}\n" } + notifications_str << "Call stack:\n" + kaller = backtrace_cleaner.clean(kaller) kaller.each do |f| - notifications_str << " #{f}\n" unless f.include?(Bundler.bundle_path.to_s) + notifications_str << " #{f}\n" end + notifications_str << "\n" end @custom_logger.warn(notifications_str) if @custom_logger