Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 1271

Show
Ignore:
Timestamp:
05/02/05 11:41:24 (4 years ago)
Author:
david
Message:

Added silencing to the default Logger class

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/CHANGELOG

    r1216 r1271  
     1*SVN* 
     2 
     3* Added silencing to the default Logger class 
     4 
     5 
    16*1.0.4* (19th April, 2005) 
    27 
  • trunk/activesupport/lib/active_support/clean_logger.rb

    r624 r1271  
    22 
    33class Logger #:nodoc: 
     4  # Silences the logger for the duration of the block. 
     5  def silence 
     6    result = nil 
     7    old_logger_level = level 
     8    self.level = Logger::ERROR 
     9    result = yield 
     10    self.level = old_logger_level 
     11    return result 
     12  end 
     13 
    414  private 
    515    remove_const "Format"