123456789_123456789_123456789_123456789_123456789_

Module: LoggerSilence

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Defined in: activesupport/lib/active_support/logger_silence.rb

Class Method Summary

Instance Method Summary

DSL Calls

included

[ GitHub ]


10
11
12
# File 'activesupport/lib/active_support/logger_silence.rb', line 10

included do
  cattr_accessor :silencer, default: true
end

Instance Method Details

#silence(temporary_level = Logger::ERROR)

Silences the logger for the duration of the block.

[ GitHub ]

  
# File 'activesupport/lib/active_support/logger_silence.rb', line 15

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