aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable/channel
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2015-06-20 16:51:11 +0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2015-06-20 16:51:11 +0200
commit995c101caae06ec38d0106dcd9ee36954a489687 (patch)
tree6bfeb3013482de2b6fc8a44226c67028b645dc9f /lib/action_cable/channel
parentf6daf0ef6d811053301c7e9b2991911caa57e841 (diff)
downloadrails-995c101caae06ec38d0106dcd9ee36954a489687.tar.gz
rails-995c101caae06ec38d0106dcd9ee36954a489687.tar.bz2
rails-995c101caae06ec38d0106dcd9ee36954a489687.zip
More logging improvements
Diffstat (limited to 'lib/action_cable/channel')
-rw-r--r--lib/action_cable/channel/base.rb2
-rw-r--r--lib/action_cable/channel/redis.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/action_cable/channel/base.rb b/lib/action_cable/channel/base.rb
index 4c90849a06..e6ca45ddcc 100644
--- a/lib/action_cable/channel/base.rb
+++ b/lib/action_cable/channel/base.rb
@@ -81,7 +81,7 @@ module ActionCable
def transmit(data, via: nil)
if authorized?
- logger.info "#{channel_name} transmitting #{data.inspect} #{via}"
+ logger.info "#{channel_name} transmitting #{data.inspect}".tap { |m| m << " (via #{via})" if via }
connection.transmit({ identifier: @channel_identifier, message: data }.to_json)
else
unauthorized
diff --git a/lib/action_cable/channel/redis.rb b/lib/action_cable/channel/redis.rb
index bdd6ab9dcf..0f77dc0418 100644
--- a/lib/action_cable/channel/redis.rb
+++ b/lib/action_cable/channel/redis.rb
@@ -14,14 +14,14 @@ module ActionCable
@_redis_channels << [ redis_channel, callback ]
pubsub.subscribe(redis_channel, &callback)
- logger.info "#{channel_name} subscribed to incoming actions from #{redis_channel}"
+ logger.info "#{channel_name} subscribed to broadcasts from #{redis_channel}"
end
def unsubscribe_from_all_channels
if @_redis_channels
@_redis_channels.each do |redis_channel, callback|
pubsub.unsubscribe_proc(redis_channel, callback)
- logger.info "#{channel_name} unsubscribed from incoming actions #{redis_channel}"
+ logger.info "#{channel_name} unsubscribed to broadcasts from #{redis_channel}"
end
end
end
@@ -29,7 +29,7 @@ module ActionCable
protected
def default_subscription_callback(channel)
-> (message) do
- transmit ActiveSupport::JSON.decode(message), via: "incoming action from #{channel}"
+ transmit ActiveSupport::JSON.decode(message), via: "broadcast from #{channel}"
end
end
end