Skip to content
Browse files

listeners are per thread, so remove nested hash

  • Loading branch information...
1 parent ceba010 commit c6af7646ad6975b46daee7e800a90fbd88431d6b @tenderlove tenderlove committed Jun 19, 2012
Showing with 4 additions and 6 deletions.
  1. +4 −6 activesupport/lib/active_support/log_subscriber.rb
View
10 activesupport/lib/active_support/log_subscriber.rb
@@ -87,27 +87,25 @@ def flush_all!
end
def initialize
- @event_stack = Hash.new { |h,id|
- h[id] = Hash.new { |ids,name| ids[name] = [] }
- }
+ @event_stack = []
super
end
def start(name, id, payload)
return unless logger
e = ActiveSupport::Notifications::Event.new(name, Time.now, nil, id, payload)
- parent = @event_stack[id][name].last
+ parent = @event_stack.last
parent << e if parent
- @event_stack[id][name].push e
+ @event_stack.push e
end
def finish(name, id, payload)
return unless logger
finished = Time.now
- event = @event_stack[id][name].pop
+ event = @event_stack.pop
event.end = finished
method = name.split('.').first

0 comments on commit c6af764

Please sign in to comment.
Something went wrong with that request. Please try again.