Sha256: 4523b3411f9a1d077309001bca39f7db799c9a4148f9a8855d045c93f4420238

Contents?: true

Size: 399 Bytes

Versions: 11

Compression:

Stored size: 399 Bytes

Contents

module Qs

  class Logger
    attr_reader :summary, :verbose

    def initialize(logger, verbose = true)
      loggers = [logger, Qs::NullLogger.new]
      loggers.reverse! if !verbose
      @verbose, @summary = loggers
    end

  end

  class NullLogger
    require 'logger'

    ::Logger::Severity.constants.each do |name|
      define_method(name.downcase){ |*args| } # no-op
    end

  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
qs-0.8.1 lib/qs/logger.rb
qs-0.8.0 lib/qs/logger.rb
qs-0.7.1 lib/qs/logger.rb
qs-0.7.0 lib/qs/logger.rb
qs-0.6.1 lib/qs/logger.rb
qs-0.6.0 lib/qs/logger.rb
qs-0.5.0 lib/qs/logger.rb
qs-0.4.0 lib/qs/logger.rb
qs-0.3.0 lib/qs/logger.rb
qs-0.2.0 lib/qs/logger.rb
qs-0.1.0 lib/qs/logger.rb