You can clone with
HTTPS or Subversion.
The latest RC added TaggedLogging which breaks the Logger#silence method which was used before to silence logger messages and is defined here https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/logger.rb#L43
(new Kernel#silence is delegated to instead). Illustration
rails new temp && cd temp && rails console
ArgumentError: wrong number of arguments (0 for 1)
from /home/evgeniy/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/core_ext/kernel/reporting.rb:68:in `capture'
So what should we do?
I've fixed that by making TaggedLogging inherit from BasicObject, tests pass, hopefully someone can review the fix below
delegating and deprecating logger#silence. fixes #4159
Could someone tell me why this is deprecated?
Wouldn't you all rather read this code:
logger.silence Logger::INFO do
orig_level, Rails.logger.level = Rails.logger.level, Logger::INFO
Rails.logger.level = orig_level
? Or am I just strange like that?
(see also: http://stackoverflow.com/questions/9076635/rails-3-2-silence-logging-deprecation-warning)
Calling silence isn't thread safe. If we make it thread safe, then all other threads must be synchronized during your silence execution.