diff options
Diffstat (limited to 'activesupport/lib/active_support')
-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 |