module LoggerSilence - activesupport-4.2.3 Documentation

# module LoggerSilence

### Public Instance Methods

silence(temporary_level = Logger::ERROR) { |self| ... } click to toggle source

Silences the logger for the duration of the block.

    # File lib/active_support/logger_silence.rb, line 12
    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