Sha256: 0f62faa01fcd2ac5a2d66f7a58f1054af1c708227d307ebb5f80e236f39febca

Contents?: true

Size: 746 Bytes

Versions: 18

Compression:

Stored size: 746 Bytes

Contents

# frozen_string_literal: true

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(_one, _two = nil, _three = nil)
        super nil
        @logdev = WarnLogDevice.new
        @formatter = ->(_s, _d, _p, m) { m }
      end
    end

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

Version data entries

18 entries across 18 versions & 6 rubygems

Version Path
kinetic_sdk-5.0.22 gems/mime-types-3.4.1/lib/mime/types/logger.rb
mime-types-3.5.1 lib/mime/types/logger.rb
mime-types-3.5.0 lib/mime/types/logger.rb
kinetic_sdk-5.0.21 gems/mime-types-3.4.1/lib/mime/types/logger.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb
kinetic_sdk-5.0.20 gems/mime-types-3.4.1/lib/mime/types/logger.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/mime-types-3.4.1/lib/mime/types/logger.rb
mime-types-3.4.1 lib/mime/types/logger.rb
mime-types-3.4.0 lib/mime/types/logger.rb