reidmorrison / rails_semantic_logger

Rails Semantic Logger replaces the Rails default logger with Semantic Logger
https://logger.rocketjob.io/rails
Apache License 2.0
320 stars 114 forks source link

Don't use 2.7+ syntax, which breaks compatibility with earlier Ruby versions #183

Closed petergoldstein closed 1 year ago

petergoldstein commented 1 year ago

Description of changes

Fixes the broken build/functionality for Ruby 2.5 and 2.6. The use of 2.7+ syntax in lib/rails_semantic_logger/engine.rb breaks this library when used with those Rubies.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

reidmorrison commented 1 year ago

Would this approach make it easier? Sidekiq::VERSION.to_i >= 7?

petergoldstein commented 1 year ago

Typically you would do something like Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new("7"). That ensures the version strings are properly compared, and you don't need to worry about the details.