lib/scrivito/log_subscriber.rb in scrivito_sdk-0.66.0 vs lib/scrivito/log_subscriber.rb in scrivito_sdk-0.70.0.rc1
- old
+ new
@@ -19,9 +19,24 @@
name = '%s (%.1fms)' % [event.payload[:name], event.duration]
debug " #{name} #{event.payload[:index]} #{event.payload[:keys].inspect}"
end
+ 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 " Scrivito #{verb_text} #{path_text}#{param_text} #{duration}"
+ end
+
def logger
Rails.logger
end
end
end