Skip to content

Commit

Permalink
Avoid invoking ActiveSupport::BroadcastLogger if not defined (#2169)
Browse files Browse the repository at this point in the history
* Avoid instantiating BroadcastLogger if not defined

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: Stan Lo <[email protected]>
  • Loading branch information
PetrHeinz and st0012 authored Nov 21, 2023
1 parent c7c8e5b commit 4edfdf1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
### Bug Fixes

- Fixed a deprecation in `sidekiq-ruby` error handler [#2160](https://github.com/getsentry/sentry-ruby/pull/2160)
- Avoid invoking ActiveSupport::BroadcastLogger if not defined [#2169](https://github.com/getsentry/sentry-ruby/pull/2169)

## 5.13.0

Expand Down
2 changes: 1 addition & 1 deletion sentry-rails/lib/sentry/rails/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Configuration
@excluded_exceptions = @excluded_exceptions.concat(Sentry::Rails::IGNORE_DEFAULT)

if ::Rails.logger
if ::Rails.logger.respond_to?(:broadcasts)
if defined?(::ActiveSupport::BroadcastLogger) && ::Rails.logger.is_a?(::ActiveSupport::BroadcastLogger)
dupped_broadcasts = ::Rails.logger.broadcasts.map(&:dup)
@logger = ::ActiveSupport::BroadcastLogger.new(*dupped_broadcasts)
else
Expand Down

0 comments on commit 4edfdf1

Please sign in to comment.