Module: LoggerSilence
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::ActiveSupport::Concern
|
|
Defined in: | activesupport/lib/active_support/logger_silence.rb |
Class Method Summary
::ActiveSupport::Concern
- Extended
Instance Method Summary
-
#silence(temporary_level = Logger::ERROR)
Silences the logger for the duration of the block.
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.
# 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