diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-03-30 00:03:11 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-03-30 00:03:11 -0300 |
commit | edbfd10876f938bd04b9034b1e4c4329cd4f2d2b (patch) | |
tree | 60306d702cb95cb0a3113db37b602eb0cf10ac2f /actioncable/lib/action_cable/channel/log_subscriber.rb | |
parent | 6786718766f10ef25af427a43e47c15ee02dc7e5 (diff) | |
download | rails-edbfd10876f938bd04b9034b1e4c4329cd4f2d2b.tar.gz rails-edbfd10876f938bd04b9034b1e4c4329cd4f2d2b.tar.bz2 rails-edbfd10876f938bd04b9034b1e4c4329cd4f2d2b.zip |
Keep logging in the ActionCable::Channel::Base
To move Action Cable logging to a LoggingSubscriber we need to pass the
log tags in the notification payload since Action Cable logging use the
Channel instance to tag the logs.
Diffstat (limited to 'actioncable/lib/action_cable/channel/log_subscriber.rb')
-rw-r--r-- | actioncable/lib/action_cable/channel/log_subscriber.rb | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/actioncable/lib/action_cable/channel/log_subscriber.rb b/actioncable/lib/action_cable/channel/log_subscriber.rb deleted file mode 100644 index d58b017e0e..0000000000 --- a/actioncable/lib/action_cable/channel/log_subscriber.rb +++ /dev/null @@ -1,40 +0,0 @@ -require 'active_support/log_subscriber' - -module ActionCable - module Channel - class LogSubscriber < ActiveSupport::LogSubscriber - def perform_action(event) - info do - channel_class = event.payload[:channel_class] - action = event.payload[:action] - "Completed #{channel_class}##{action} in #{event.duration.round}ms" - end - end - - def transmit(event) - info do - channel_class = event.payload[:channel_class] - data = event.payload[:data] - via = event.payload[:via] - "#{channel_class} transmitting #{data.inspect.truncate(300)}".tap { |m| m << " (via #{via})" if via } - end - end - - def transmit_subscription_confirmation(event) - info do - channel_class = event.payload[:channel_class] - "#{channel_class} is transmitting the subscription confirmation" - end - end - - def transmit_subscription_rejection(event) - info do - channel_class = event.payload[:channel_class] - "#{channel_class} is transmitting the subscription rejection" - end - end - end - end -end - -ActionCable::Channel::LogSubscriber.attach_to :action_cable |