Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4484 from lest/patch-1

use thread variable in TaggedLogging
  • Loading branch information...
commit 81e837e810460d066a2e5fc5a795366ec8ab2313 2 parents a200446 + 6e76f8f
@josevalim josevalim authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 activesupport/lib/active_support/tagged_logging.rb
View
5 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 @@ def #{severity}(progname = nil, &block) # def warn(progname = nil,
end
def flush
- @tags.delete(Thread.current)
+ current_tags.clear
@logger.flush if @logger.respond_to?(:flush)
end
@@ -57,7 +56,7 @@ def tags_text
end
def current_tags
- @tags[Thread.current]
+ Thread.current[:activesupport_tagged_logging_tags] ||= []
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.