From 24c6da796b7ed0bdd9fdda85cbe1ca4b283d0dfe Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Mon, 7 Aug 2023 00:01:00 -0400 Subject: [PATCH] Update release documentation for logging changes - Also update other message log levels. --- History.md | 14 +++++++++++++- lib/mime/type.rb | 2 +- lib/mime/types/cache.rb | 4 ++-- lib/mime/types/deprecations.rb | 2 +- lib/mime/types/registry.rb | 2 +- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/History.md b/History.md index b45679b..a41fd62 100644 --- a/History.md +++ b/History.md @@ -1,6 +1,17 @@ # Changelog -## 3.4.2 / 2023-08-07 +## 3.5.0 / 2023-08-07 + +- 1 minor enhancement: + + - Robb Shecter changed the default log level for duplicate type variant from + `warn` to `debug` in [#170][]. This works because `MIME::Types.logger` is + intended to fit the `::Logger` interface, and the default logger + (`WarnLogger`) is a subclass of `::Logger` that passes through to + `Kernel.warn`. + + - Further consideration has changed cache load messages from `warn` to + `error` and deprecation messages from `warn` to `debug`. - 1 bug fix: @@ -292,6 +303,7 @@ [#153]: https://github.com/mime-types/ruby-mime-types/pull/153 [#166]: https://github.com/mime-types/ruby-mime-types/issues/166 [#167]: https://github.com/mime-types/ruby-mime-types/pull/167 +[#170]: https://github.com/mime-types/ruby-mime-types/pull/170 [code-of-conduct.md]: Code-of-Conduct_md.html [contributor covenant]: http://contributor-covenant.org [mime-types-data]: https://github.com/mime-types/mime-types-data diff --git a/lib/mime/type.rb b/lib/mime/type.rb index d7c2a9f..feae131 100644 --- a/lib/mime/type.rb +++ b/lib/mime/type.rb @@ -93,7 +93,7 @@ def to_s end # The released version of the mime-types library. - VERSION = "3.4.2" + VERSION = "3.5.0" include Comparable diff --git a/lib/mime/types/cache.rb b/lib/mime/types/cache.rb index 2e70775..aecbf7b 100644 --- a/lib/mime/types/cache.rb +++ b/lib/mime/types/cache.rb @@ -22,13 +22,13 @@ def load(cache_file = nil) if cache.version == MIME::Types::Data::VERSION Marshal.load(cache.data) else - MIME::Types.logger.warn <<-WARNING.chomp.strip + MIME::Types.logger.error <<-WARNING.chomp.strip Could not load MIME::Types cache: invalid version WARNING nil end rescue => e - MIME::Types.logger.warn <<-WARNING.chomp.strip + MIME::Types.logger.error <<-WARNING.chomp.strip Could not load MIME::Types cache: #{e} WARNING nil diff --git a/lib/mime/types/deprecations.rb b/lib/mime/types/deprecations.rb index cf9c297..dc869fa 100644 --- a/lib/mime/types/deprecations.rb +++ b/lib/mime/types/deprecations.rb @@ -25,7 +25,7 @@ def self.deprecated(klass, sym, message = nil, &block) # :nodoc: else message end - MIME::Types.logger.warn <<-WARNING.chomp.strip + MIME::Types.logger.debug <<-WARNING.chomp.strip #{caller(2..2).first}: #{klass}#{level}#{sym} is deprecated #{message}. WARNING diff --git a/lib/mime/types/registry.rb b/lib/mime/types/registry.rb index e557a5c..eb27094 100644 --- a/lib/mime/types/registry.rb +++ b/lib/mime/types/registry.rb @@ -45,7 +45,7 @@ def add(*types) def lazy_load? return unless ENV.key?("RUBY_MIME_TYPES_LAZY_LOAD") - MIME::Types.logger.warn <<-WARNING.chomp.strip + MIME::Types.logger.debug <<-WARNING.chomp.strip Lazy loading ($RUBY_MIME_TYPES_LAZY_LOAD) is deprecated and will be removed. WARNING