Class: Frails::LogSubscriber

Inherits:
ActiveSupport::LogSubscriber
  • Object
show all
Defined in:
lib/frails/log_subscriber.rb

Constant Summary collapse

VIEWS_PATTERN =
%r{^app/views/}.freeze

Instance Method Summary collapse

Instance Method Details

#render_side_loaded_assets(event) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/frails/log_subscriber.rb', line 9

def render_side_loaded_assets(event)
  return if (asset_types = event.payload[:asset_types]).empty?

  identifier_from_root = from_rails_root(event.payload[:identifier])

  info do
    message = +"  Side loaded #{asset_types.join(',')} for #{identifier_from_root}"
    message << " (Duration: #{event.duration.round(1)}ms | Allocations: #{event.allocations})"
  end
end