Skip to content

Commit

Permalink
Update release documentation for logging changes
Browse files Browse the repository at this point in the history
- Also update other message log levels.
  • Loading branch information
halostatue committed Aug 7, 2023
1 parent ceec17c commit 24c6da7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
14 changes: 13 additions & 1 deletion History.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/mime/type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/mime/types/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/mime/types/deprecations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/mime/types/registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 24c6da7

Please sign in to comment.