Class: BrainzLab::Rails::CableLogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- BrainzLab::Rails::CableLogSubscriber
- Defined in:
- lib/brainzlab/rails/log_subscriber.rb
Overview
ActionCable subscriber for broadcast formatting
Constant Summary collapse
- COLORS =
LogFormatter::COLORS
Instance Method Summary collapse
Instance Method Details
#broadcast(event) ⇒ Object
159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/brainzlab/rails/log_subscriber.rb', line 159 def broadcast(event) payload = event.payload broadcasting = payload[:broadcasting] = payload[:message] # Decode the channel name from the gid channel_name = decode_broadcasting(broadcasting) # Format the message summary = () output = build_output(channel_name, , event.duration) $stdout.write(output) end |