Sha256: 35d15c68bfcc90978642326e97c570c6558b0ddbbd49a9dc6cead3d09abbbebb

Contents?: true

Size: 550 Bytes

Versions: 4

Compression:

Stored size: 550 Bytes

Contents

# Originals
require "active_support/concern"
require "active_support/core_ext/module/attribute_accessors"

# Extracted
require "activesupport/logger_thread_safe_level"

module ActiveSupport
  module LoggerSilence
    extend ActiveSupport::Concern

    included do
      cattr_accessor :silencer, default: true
      include ActiveSupport::LoggerThreadSafeLevel
    end

    # Silences the logger for the duration of the block.
    def silence(severity = Logger::ERROR)
      silencer ? log_at(severity) { yield self } : yield(self)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activesupport-logger-2.0.3 lib/activesupport/logger_silence.rb
activesupport-logger-2.0.2 lib/activesupport/logger_silence.rb
activesupport-logger-2.0.1 lib/activesupport/logger_silence.rb
activesupport-logger-2.0.0 lib/activesupport/logger_silence.rb