Sha256: 66e7f53a10fd3b713f4e34dd521dae26819926264d5d364bf1060226ec84ed22
Contents?: true
Size: 628 Bytes
Versions: 48
Compression:
Stored size: 628 Bytes
Contents
# frozen_string_literal: true require "active_support/concern" require "active_support/core_ext/module/attribute_accessors" require "concurrent" module LoggerSilence extend ActiveSupport::Concern included do cattr_accessor :silencer, default: 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
48 entries across 48 versions & 7 rubygems