TwP / logging

A flexible logging library for use in Ruby programs based on the design of Java's log4j library.
https://rubygems.org/gems/logging
MIT License
530 stars 101 forks source link

Warning on Ruby 3.3 because of requiring `syslog` package #247

Open Earlopain opened 5 months ago

Earlopain commented 5 months ago

Ruby 3.3 will issue a warning when requiring syslog, Ruby 3.4 will raise an error. https://github.com/ruby/ruby/blob/master/doc/NEWS/NEWS-3.3.0.md#stdlib-updates

I'm talking about these lines of code: https://github.com/TwP/logging/blob/df41715364f7eb8c65098cd3c3316677ef1f3784/lib/logging.rb#L9-L15

This already handles the absense of syslog which is good so the gem will not break (much) in the future because of this. However, on Ruby 3.3 a warning message is logged nontheless. Users on linux that use the syslog appender will have that class be undefined on Ruby 3.4.

/home/user/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/logging-2.3.1/lib/logging.rb:10: warning: syslog was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add syslog to your Gemfile or gemspec. Also contact author of logging-2.3.1 to add syslog into its gemspec.

mhenrixon commented 1 month ago

This one is a little more critical though:

ArgumentError: comparison of String with nil failed (ArgumentError)

    msg = " #{RUBY_VERSION < SINCE[gem] ? "will no longer be" : "is not"} part of the default gems since Ruby #{SINCE[gem]}."
                             ^^^^^^^^^^
/home/runner/work/cosmos/cosmos/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/home/runner/work/cosmos/cosmos/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.14/lib/zeitwerk/kernel.rb:34:in `require'
/home/runner/work/cosmos/cosmos/vendor/bundle/ruby/3.3.0/gems/logging-2.3.1/lib/logging.rb:10:in `<main>'
Earlopain commented 1 month ago

Ruby bug :disappointed: https://bugs.ruby-lang.org/issues/20450

mhenrixon commented 1 month ago

I only get this with the logging gem though 🤣

Thanks for the feedback