Sha256: 69c43ebee3d3da86cbc9d2b4c0cb22c6de81ada8cb02fbc4d25e8dda2124a916

Contents?: true

Size: 641 Bytes

Versions: 68

Compression:

Stored size: 641 Bytes

Contents

# frozen_string_literal: true

require 'active_support/log_subscriber'

module Proscenium
  class LogSubscriber < ActiveSupport::LogSubscriber
    def sideload(event)
      info do
        "  [Proscenium] Side loaded #{event.payload[:identifier]}"
      end
    end

    def build(event)
      path = event.payload[:identifier]
      path = CGI.unescape(path) if path.start_with?(/https?%3A%2F%2F/)

      info do
        message = +"[Proscenium] Building #{path}"
        message << " (Duration: #{event.duration.round(1)}ms | Allocations: #{event.allocations})"
      end
    end
  end
end

Proscenium::LogSubscriber.attach_to :proscenium

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
proscenium-0.14.0-x86_64-linux lib/proscenium/log_subscriber.rb
proscenium-0.14.0-aarch64-linux lib/proscenium/log_subscriber.rb
proscenium-0.14.0-arm64-darwin lib/proscenium/log_subscriber.rb
proscenium-0.14.0-x86_64-darwin lib/proscenium/log_subscriber.rb
proscenium-0.13.0-x86_64-linux lib/proscenium/log_subscriber.rb
proscenium-0.13.0-aarch64-linux lib/proscenium/log_subscriber.rb
proscenium-0.13.0-arm64-darwin lib/proscenium/log_subscriber.rb
proscenium-0.13.0-x86_64-darwin lib/proscenium/log_subscriber.rb
proscenium-0.12.0-x86_64-linux lib/proscenium/log_subscriber.rb
proscenium-0.12.0-aarch64-linux lib/proscenium/log_subscriber.rb
proscenium-0.12.0-arm64-darwin lib/proscenium/log_subscriber.rb
proscenium-0.12.0-x86_64-darwin lib/proscenium/log_subscriber.rb
proscenium-0.11.0-x86_64-linux lib/proscenium/log_subscriber.rb
proscenium-0.11.0-aarch64-linux lib/proscenium/log_subscriber.rb
proscenium-0.11.0-arm64-darwin lib/proscenium/log_subscriber.rb
proscenium-0.11.0-x86_64-darwin lib/proscenium/log_subscriber.rb
proscenium-0.11.0.pre.13-x86_64-linux lib/proscenium/log_subscriber.rb
proscenium-0.11.0.pre.13-aarch64-linux lib/proscenium/log_subscriber.rb
proscenium-0.11.0.pre.13-arm64-darwin lib/proscenium/log_subscriber.rb
proscenium-0.11.0.pre.13-x86_64-darwin lib/proscenium/log_subscriber.rb