Methods

Instance Public methods

silence(temporary_level = Logger::ERROR)

Silences the logger for the duration of the block.

📝 Source code
# File activesupport/lib/active_support/logger_silence.rb, line 30
    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
🔎 See on GitHub