Class: PufferPages::LogSubscriber

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

Instance Method Summary collapse

Instance Method Details

#duration(event) ⇒ Object



23
24
25
# File 'lib/puffer_pages/log_subscriber.rb', line 23

def duration event
  '(%.1fms)' % event.duration
end

#render_layout(event) ⇒ Object



13
14
15
16
# File 'lib/puffer_pages/log_subscriber.rb', line 13

def render_layout event
  message = "  PufferPages: rendered layout #{event.payload[:subject].name} #{duration(event)}"
  debug message
end

#render_page(event) ⇒ Object



3
4
5
6
# File 'lib/puffer_pages/log_subscriber.rb', line 3

def render_page event
  message = "  PufferPages: rendered page /#{event.payload[:subject].location} #{duration(event)}"
  info message
end

#render_page_part(event) ⇒ Object



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

def render_page_part event
  message = "  PufferPages: rendered page_part #{event.payload[:subject].name} #{duration(event)}"
  debug message
end

#render_snippet(event) ⇒ Object



18
19
20
21
# File 'lib/puffer_pages/log_subscriber.rb', line 18

def render_snippet event
  message = "  PufferPages: rendered snippet #{event.payload[:subject].name} #{duration(event)}"
  debug message
end