diff options
author | Carl P. Corliss <rabbitt@gmail.com> | 2015-06-09 22:38:53 -0400 |
---|---|---|
committer | Carl P. Corliss <rabbitt@gmail.com> | 2015-12-23 12:57:33 -0500 |
commit | 629efb605728b31ad9644f6f0acaf3760b641a29 (patch) | |
tree | 78f05d8972b8d3ef5d716a3078b91a80130d3ecb /activerecord | |
parent | 2ad6deb5344abd77515f1c04edbd586a5538f705 (diff) | |
download | rails-629efb605728b31ad9644f6f0acaf3760b641a29.tar.gz rails-629efb605728b31ad9644f6f0acaf3760b641a29.tar.bz2 rails-629efb605728b31ad9644f6f0acaf3760b641a29.zip |
Fixes LoggerSilence#silence threadsafety
- uses instance defined level if no custom local log level defined
- Keeps track of local log level per [ thread + object-instance ]
- prevents memory leakage by removing local level hash key/value on #silence method exit
- avoids the use of Thread local variables
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index f343a15317..ba3e16bdb2 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1252,6 +1252,7 @@ class BasicsTest < ActiveRecord::TestCase original_logger = ActiveRecord::Base.logger log = StringIO.new ActiveRecord::Base.logger = ActiveSupport::Logger.new(log) + ActiveRecord::Base.logger.level = Logger::DEBUG ActiveRecord::Base.benchmark("Logging", :level => :debug, :silence => false) { ActiveRecord::Base.logger.debug "Quiet" } assert_match(/Quiet/, log.string) ensure |