Sha256: 50ce68062dbc4d7fd0a5cbc7713fba9dc2236c2c1cb2c795c31d2d7e55de6cc6

Contents?: true

Size: 726 Bytes

Versions: 4

Compression:

Stored size: 726 Bytes

Contents

# frozen_string_literal: true

Rails.application.config.view_component.capture_compatibility_patch_enabled = true

if Rails.env.development? || Rails.env.test?
  Rails.application.config.view_component.instrumentation_enabled = true
  Rails.application.config.view_component.use_deprecated_instrumentation_name = false

  bold  = "\e[1m"
  clear = "\e[0m"

  ActiveSupport::Notifications.subscribe("render.view_component") do |*args|
    next unless args.last[:name]&.starts_with?("SolidusAdmin::")

    event = ActiveSupport::Notifications::Event.new(*args)
    SolidusAdmin::BaseComponent.logger.debug \
      "  Rendered #{bold}#{event.payload[:name]}#{clear}" \
      " (Duration: #{event.duration.round(1)}ms)"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solidus_admin-0.3.2 config/initializers/view_component.rb
solidus_admin-0.3.1 config/initializers/view_component.rb
solidus_admin-0.3.0 config/initializers/view_component.rb
solidus_admin-0.2.0 config/initializers/view_component.rb