diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-24 10:34:54 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-24 10:34:54 -0700 |
commit | b590fe4892d312cbdde350e7c4f8fbbcaf8c61ee (patch) | |
tree | 358869926aadda7bd07fd9ff8349bb8003f1c499 /activesupport/lib | |
parent | 0e8cbbe7d52deaf0e27121e281ebd60118d89bad (diff) | |
download | rails-b590fe4892d312cbdde350e7c4f8fbbcaf8c61ee.tar.gz rails-b590fe4892d312cbdde350e7c4f8fbbcaf8c61ee.tar.bz2 rails-b590fe4892d312cbdde350e7c4f8fbbcaf8c61ee.zip |
delegating and deprecating logger#silence. fixes #4159
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/logger.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/tagged_logging.rb | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/logger.rb b/activesupport/lib/active_support/core_ext/logger.rb index e63a0a9ed9..ca0f382966 100644 --- a/activesupport/lib/active_support/core_ext/logger.rb +++ b/activesupport/lib/active_support/core_ext/logger.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/class/attribute_accessors' +require 'active_support/deprecation' # Adds the 'around_level' method to Logger. class Logger #:nodoc: @@ -49,6 +50,7 @@ class Logger yield self end end + deprecate :silence alias :old_datetime_format= :datetime_format= # Logging date-time format (string passed to +strftime+). Ignored if the formatter diff --git a/activesupport/lib/active_support/tagged_logging.rb b/activesupport/lib/active_support/tagged_logging.rb index 0f3ac0c132..a3a2c48817 100644 --- a/activesupport/lib/active_support/tagged_logging.rb +++ b/activesupport/lib/active_support/tagged_logging.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/object/blank' +require 'active_support/deprecation' require 'logger' module ActiveSupport @@ -26,6 +27,11 @@ module ActiveSupport new_tags.size.times { tags.pop } end + def silence(temporary_level = ERROR, &block) + @logger.silience(temporary_level, &block) + end + deprecate :silence + def add(severity, message = nil, progname = nil, &block) @logger.add(severity, "#{tags_text}#{message}", progname, &block) end |