Sha256: 6f271da8e11865392ff5299ba008d765bf471480780471b3df77a6c4a16817e3

Contents?: true

Size: 737 Bytes

Versions: 55

Compression:

Stored size: 737 Bytes

Contents

# -*- ruby encoding: utf-8 -*-

require 'logger'

##
module MIME
  ##
  class Types
    class << self
      # Configure the MIME::Types logger. This defaults to an instance of a
      # logger that passes messages (unformatted) through to Kernel#warn.
      attr_accessor :logger
    end

    class WarnLogger < ::Logger #:nodoc:
      class WarnLogDevice < ::Logger::LogDevice #:nodoc:
        def initialize(*)
        end

        def write(m)
          Kernel.warn(m)
        end

        def close
        end
      end

      def initialize(_1, _2 = nil, _3 = nil)
        super nil
        @logdev = WarnLogDevice.new
        @formatter = ->(_s, _d, _p, m) { m }
      end
    end

    self.logger = WarnLogger.new(nil)
  end
end

Version data entries

55 entries across 51 versions & 9 rubygems

Version Path
kinetic_sdk-5.0.18 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.17 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.16 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.15 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.14 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.13 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.12 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.11 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.10 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.9 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.8 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.7 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.6 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.5 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.4 gems/mime-types-3.1/lib/mime/types/logger.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.3 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.2 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.2.beta.4 gems/mime-types-3.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.2.beta.3 gems/mime-types-3.1/lib/mime/types/logger.rb