Sha256: 8bfa328abd06c512c412bc5ed4d980acf987ff635865142592b0f198e8b49b0e
Contents?: true
Size: 480 Bytes
Versions: 108
Compression:
Stored size: 480 Bytes
Contents
require 'active_support/concern' module LoggerSilence extend ActiveSupport::Concern included do cattr_accessor :silencer self.silencer = true end # Silences the logger for the duration of the block. def silence(temporary_level = Logger::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 end
Version data entries
108 entries across 103 versions & 10 rubygems