Skip to content

Commit

Permalink
fix: create broadcast logger if current is not broadastable
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Dec 12, 2023
1 parent 87e16d7 commit b6d4cc5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/anycable/rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ class Railtie < ::Rails::Railtie # :nodoc:
# Rails 7.1+
if AnyCable.logger.respond_to?(:broadcast_to)
AnyCable.logger.broadcast_to(console)
else
elsif ActiveSupport::Logger.respond_to?(:broadcast)
AnyCable.logger.extend(ActiveSupport::Logger.broadcast(console))
elsif defined?(ActiveSupport::BroadcastLogger)
AnyCable.logger = ActiveSupport::BroadcastLogger.new(AnyCable.logger, console)
end
end

Expand Down

0 comments on commit b6d4cc5

Please sign in to comment.