1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #4484 from lest/patch-1

use thread variable in TaggedLogging
This commit is contained in:
José Valim 2012-01-17 00:24:08 -08:00
commit 81e837e810

View file

@ -14,7 +14,6 @@ module ActiveSupport
class TaggedLogging
def initialize(logger)
@logger = logger
@tags = Hash.new { |h,k| h[k] = [] }
end
def tagged(*new_tags)
@ -39,7 +38,7 @@ module ActiveSupport
end
def flush
@tags.delete(Thread.current)
current_tags.clear
@logger.flush if @logger.respond_to?(:flush)
end
@ -57,7 +56,7 @@ module ActiveSupport
end
def current_tags
@tags[Thread.current]
Thread.current[:activesupport_tagged_logging_tags] ||= []
end
end
end