Class: Scrivito::LogSubscriber

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

Instance Method Summary collapse

Instance Method Details

#backend_request(event) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/fiona7/scrivito_patches/log_subscriber.rb', line 3

def backend_request(event)
  self.class.runtime += event.duration
  return unless logger.debug?

  duration = '(%.1fms)' % [event.duration]

  param = event.payload[:params]
  param_text = " #{param}" if param

  verb_text = event.payload[:verb].upcase
  path_text = event.payload[:path]

  debug "  Fiona7 #{verb_text} #{path_text}#{param_text} #{duration}"
end