instance method silence

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v3.2.22.5

Available in: v2.2.3 v2.3.18 v3.0.20 v3.1.12 v3.2.22.5

Signature

silence(temporary_level = ERROR)

Silences the logger for the duration of the block.

Parameters

temporary_level opt = ERROR
Source
# File activesupport/lib/active_support/buffered_logger.rb, line 25
    def silence(temporary_level = 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

Defined in activesupport/lib/active_support/buffered_logger.rb line 25 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::BufferedLogger

Type at least 2 characters to search.

↑↓ navigate · open · esc close