Skip to content

Commit

Permalink
Merge pull request rails#50923 from Shopify/core-silencer
Browse files Browse the repository at this point in the history
BacktraceCleaner silence core internal methods by default
  • Loading branch information
byroot committed Jan 30, 2024
2 parents eb6e53c + 794016a commit c900558
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions activesupport/lib/active_support/backtrace_cleaner.rb
Expand Up @@ -34,6 +34,7 @@ module ActiveSupport
class BacktraceCleaner
def initialize
@filters, @silencers = [], []
add_core_silencer
add_gem_filter
add_gem_silencer
add_stdlib_silencer
Expand Down Expand Up @@ -118,6 +119,10 @@ def add_gem_filter
add_filter { |line| line.sub(gems_regexp, gems_result) }
end

def add_core_silencer
add_silencer { |line| line.include?("<internal:") }
end

def add_gem_silencer
add_silencer { |line| FORMATTED_GEMS_PATTERN.match?(line) }
end
Expand Down

0 comments on commit c900558

Please sign in to comment.