diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-17 00:24:08 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-17 00:24:08 -0800 |
commit | 81e837e810460d066a2e5fc5a795366ec8ab2313 (patch) | |
tree | 9f27a6382936f0ef29c6f784d47f71449c843116 | |
parent | a200446c5311477a17f6ff96c32215c72690f8b7 (diff) | |
parent | 6e76f8f5c05cb2f00d7a2f4d58e6dd35a23655f6 (diff) | |
download | rails-81e837e810460d066a2e5fc5a795366ec8ab2313.tar.gz rails-81e837e810460d066a2e5fc5a795366ec8ab2313.tar.bz2 rails-81e837e810460d066a2e5fc5a795366ec8ab2313.zip |
Merge pull request #4484 from lest/patch-1
use thread variable in TaggedLogging
-rw-r--r-- | activesupport/lib/active_support/tagged_logging.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/tagged_logging.rb b/activesupport/lib/active_support/tagged_logging.rb index dc3ca25938..4e2e1a1ff5 100644 --- a/activesupport/lib/active_support/tagged_logging.rb +++ b/activesupport/lib/active_support/tagged_logging.rb @@ -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 |