debug(action_cable): add server-side broadcast logging
- Log channel remapping and data on every broadcast - Log warnings when channel format is unknown - Helps trace whether broadcasts reach ActionCable.server
This commit is contained in:
@@ -30,8 +30,12 @@ module Mozo
|
|||||||
data = message[:data] || message['data']
|
data = message[:data] || message['data']
|
||||||
|
|
||||||
remapped = remap_channel(channel)
|
remapped = remap_channel(channel)
|
||||||
return unless remapped
|
unless remapped
|
||||||
|
Rails.logger.warn("[ACTION_CABLE] broadcast skipped: unknown channel #{channel}")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
Rails.logger.debug("[ACTION_CABLE] broadcasting to #{remapped}: #{data.inspect}")
|
||||||
::ActionCable.server.broadcast(remapped, data)
|
::ActionCable.server.broadcast(remapped, data)
|
||||||
rescue => e
|
rescue => e
|
||||||
Rails.logger.error("[ACTION_CABLE][ERROR] #{e.message}")
|
Rails.logger.error("[ACTION_CABLE][ERROR] #{e.message}")
|
||||||
|
|||||||
Reference in New Issue
Block a user