def setup_backtrace_cleaner
      setup_backtrace_cleaner_path
      return if ActiveRecordQueryTrace.level == :full

      remove_filters_and_silencers

      case ActiveRecordQueryTrace.level
      when :app
        Rails.backtrace_cleaner.add_silencer { |line| line !~ rails_root_regexp }
      when :rails
        Rails.backtrace_cleaner.add_silencer { |line| line =~ rails_root_regexp }
      end
    end
def setup_backtrace_cleaner
      setup_backtrace_cleaner_path
      return if ActiveRecordQueryTrace.level == :full

      remove_filters_and_silencers

      case ActiveRecordQueryTrace.level
      when :app
        Rails.backtrace_cleaner.add_silencer { |line| line !~ rails_root_regexp }
      when :rails
        Rails.backtrace_cleaner.add_silencer { |line| line =~ rails_root_regexp }
      end
    end
Rails by default silences all backtraces that *do not* match
 Rails::BacktraceCleaner::APP_DIRS_PATTERN. In other words, the default
 silencer filters out all framework backtrace lines, leaving only the
 application lines.