edge badge
Methods
S
Instance Public methods
silence(temporary_level = Logger::ERROR)

Silences the logger for the duration of the block.

# File activesupport/lib/active_support/logger_silence.rb, line 14
def silence(temporary_level = Logger::ERROR)
  if silencer
    begin
      old_local_level            = local_level
      self.local_level           = temporary_level

      yield self
    ensure
      self.local_level = old_local_level
    end
  else
    yield self
  end
end