From 9886a995f5f0b32d0d400074c48221cb0f6b911e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 20 Jun 2015 18:09:58 +0200 Subject: Better logging --- lib/action_cable/channel/base.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/action_cable/channel/base.rb b/lib/action_cable/channel/base.rb index 83ba2cb3d2..12a5789bdc 100644 --- a/lib/action_cable/channel/base.rb +++ b/lib/action_cable/channel/base.rb @@ -42,10 +42,10 @@ module ActionCable action = extract_action(data) if performable_action?(action) - logger.info channel_name + compose_signature(action, data) + logger.info action_signature(action, data) public_send action, data else - logger.error "#{channel_name} failed to process #{compose_signature(action, data)}" + logger.error "Unable to process #{action_signature(action, data)}" end else unauthorized @@ -102,8 +102,8 @@ module ActionCable self.class.instance_methods(false).include?(action) end - def compose_signature(action, data) - "##{action}".tap do |signature| + def action_signature(action, data) + "#{channel_name}##{action}".tap do |signature| if (arguments = data.except('action')).any? signature << "(#{arguments.inspect})" end -- cgit v1.2.3