Class: Proscenium::LogSubscriber

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

Instance Method Summary collapse

Instance Method Details

#build_to_string(event) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/proscenium/log_subscriber.rb', line 13

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

  info do
    message = "  #{color('[Proscenium]', nil, bold: true)} Building (to string) #{path}"
    message << " (Duration: #{event.duration.round(1)}ms | Allocations: #{event.allocations})"
  end
end

#sideload(event) ⇒ Object



7
8
9
10
11
# File 'lib/proscenium/log_subscriber.rb', line 7

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