From cbcb947b00a7c6992cfe42c6b369e87b4fa4ee23 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Tue, 27 Oct 2009 21:01:31 -0700 Subject: AS::Notifications.subscribe blocks are now yielded the arguments to pass to AS::Notifications::Event.new --- actionpack/lib/action_controller/notifications.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/notifications.rb b/actionpack/lib/action_controller/notifications.rb index 4ec88193d5..1a4f29e0e2 100644 --- a/actionpack/lib/action_controller/notifications.rb +++ b/actionpack/lib/action_controller/notifications.rb @@ -1,6 +1,8 @@ require 'active_support/notifications' -ActiveSupport::Notifications.subscribe(/(read|write|cache|expire|exist)_(fragment|page)\??/) do |event| +ActiveSupport::Notifications.subscribe(/(read|write|cache|expire|exist)_(fragment|page)\??/) do |*args| + event = ActiveSupport::Notifications::Event.new(*args) + if logger = ActionController::Base.logger human_name = event.name.to_s.humanize logger.info("#{human_name} (%.1fms)" % event.duration) -- cgit v1.2.3