aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/channel
diff options
context:
space:
mode:
authorJankees van Woezik <jankeesvw@gmail.com>2016-02-16 14:45:26 +0100
committerJankees van Woezik <jankees@base42.nl>2016-02-18 15:42:57 +0100
commit3fe383c6015cdbe9874340d8d8bc1a5954d08234 (patch)
treedef03f249c14fa69bf07ae6d9e12a906baff2ad2 /actioncable/lib/action_cable/channel
parentb0b61b62f9c27eff5b9e0797a0de0d35d64d1620 (diff)
downloadrails-3fe383c6015cdbe9874340d8d8bc1a5954d08234.tar.gz
rails-3fe383c6015cdbe9874340d8d8bc1a5954d08234.tar.bz2
rails-3fe383c6015cdbe9874340d8d8bc1a5954d08234.zip
Truncate ActionCable broadcast message to 300 chars
When running the ActionCable server in development I get a lot of output in my logs, this commit sets a maximum length of 300 characters for a broadcast log message.
Diffstat (limited to 'actioncable/lib/action_cable/channel')
-rw-r--r--actioncable/lib/action_cable/channel/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actioncable/lib/action_cable/channel/base.rb b/actioncable/lib/action_cable/channel/base.rb
index 874ebe2e71..86c8f12f6e 100644
--- a/actioncable/lib/action_cable/channel/base.rb
+++ b/actioncable/lib/action_cable/channel/base.rb
@@ -191,7 +191,7 @@ module ActionCable
# Transmit a hash of data to the subscriber. The hash will automatically be wrapped in a JSON envelope with
# the proper channel identifier marked as the recipient.
def transmit(data, via: nil)
- logger.info "#{self.class.name} transmitting #{data.inspect}".tap { |m| m << " (via #{via})" if via }
+ logger.info "#{self.class.name} transmitting #{data.inspect.truncate(300)}".tap { |m| m << " (via #{via})" if via }
connection.transmit ActiveSupport::JSON.encode(identifier: @identifier, message: data)
end