public Method

Logger.silence(temporary_level = Logger::ERROR) { |self| ... }

Silences the logger for the duration of the block.

Source Code

# File active_support/clean_logger.rb, line 22
def silence(temporary_level = Logger::ERROR)
  if silencer
    begin
      old_logger_level, self.level = level, temporary_level
      yield self
    ensure
      self.level = old_logger_level
    end
  else
    yield self
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.