1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Fix stack level too deep when Sidekiq.logger == Rails.logger (#5065)

This commit is contained in:
Marc-Antoine Leblond 2021-11-22 12:48:30 -05:00 committed by GitHub
parent 25ae4c4848
commit 837745ac9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,7 @@ module Sidekiq
# This is the integration code necessary so that if code uses `Rails.logger.info "Hello"`,
# it will appear in the Sidekiq console with all of the job context. See #5021 and
# https://github.com/rails/rails/blob/b5f2b550f69a99336482739000c58e4e04e033aa/railties/lib/rails/commands/server/server_command.rb#L82-L84
unless ::ActiveSupport::Logger.logger_outputs_to?(::Rails.logger, $stdout)
unless ::Rails.logger == ::Sidekiq.logger || ::ActiveSupport::Logger.logger_outputs_to?(::Rails.logger, $stdout)
::Rails.logger.extend(::ActiveSupport::Logger.broadcast(::Sidekiq.logger))
end
end