aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/notifications
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-12-26 20:28:53 +0100
committerJosé Valim <jose.valim@gmail.com>2009-12-26 20:28:53 +0100
commit75ba102a80965b2612df0253d1278581a88b8d66 (patch)
tree435658d7914821be2e745bf3468139cf6a753a07 /activesupport/lib/active_support/notifications
parent8a36e907d2a0a28be1fa8334221cc2e195d75168 (diff)
downloadrails-75ba102a80965b2612df0253d1278581a88b8d66.tar.gz
rails-75ba102a80965b2612df0253d1278581a88b8d66.tar.bz2
rails-75ba102a80965b2612df0253d1278581a88b8d66.zip
Remove ActionView inline logging to ActiveSupport::Notifications and create ActionController::Base#log_event, so everything can be logged within one listener. Also expose log_process_action as a hook for different modules to include their own information during the action processing. This allow ActiveRecord to hook and any other ORM. Finally, this commit changes 'Processing' and 'Rendering' in logs to 'Processed' and 'Rendered' because at the point it's logged, everying already happened.
Diffstat (limited to 'activesupport/lib/active_support/notifications')
-rw-r--r--activesupport/lib/active_support/notifications/instrumenter.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/notifications/instrumenter.rb b/activesupport/lib/active_support/notifications/instrumenter.rb
index fb95422af2..0655dd0cb6 100644
--- a/activesupport/lib/active_support/notifications/instrumenter.rb
+++ b/activesupport/lib/active_support/notifications/instrumenter.rb
@@ -10,10 +10,10 @@ module ActiveSupport
end
def instrument(name, payload={})
- time = Time.now
- result = yield if block_given?
+ time = Time.now
+ yield if block_given?
ensure
- @notifier.publish(name, time, Time.now, result, @id, payload)
+ @notifier.publish(name, time, Time.now, @id, payload)
end
private
@@ -23,15 +23,14 @@ module ActiveSupport
end
class Event
- attr_reader :name, :time, :end, :transaction_id, :result, :payload
+ attr_reader :name, :time, :end, :transaction_id, :payload
- def initialize(name, start, ending, result, transaction_id, payload)
+ def initialize(name, start, ending, transaction_id, payload)
@name = name
@payload = payload.dup
@time = start
@transaction_id = transaction_id
@end = ending
- @result = result
end
def duration