diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/notifications.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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) |