Sha256: dadfb39427ab4ac6ba370188eaf68bba110a25a8a65026238c0eb94ddf0b5a61
Contents?: true
Size: 547 Bytes
Versions: 19
Compression:
Stored size: 547 Bytes
Contents
require 'active_support/concern' require 'thread_safe' 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_local_level = local_level self.local_level = temporary_level yield self ensure self.local_level = old_local_level end else yield self end end end
Version data entries
19 entries across 19 versions & 4 rubygems