Skip to content

Add logger gem to fix Ruby 4.0 deprecation warning#63

Merged
chorrell merged 1 commit intomainfrom
fix-logger-deprecation-warning
Feb 10, 2026
Merged

Add logger gem to fix Ruby 4.0 deprecation warning#63
chorrell merged 1 commit intomainfrom
fix-logger-deprecation-warning

Conversation

@chorrell
Copy link
Owner

Summary

Fixes Ruby 4.0 deprecation warning by explicitly adding the logger gem to dependencies.

Problem

When running tests with Ruby 3.4+, this warning appears:

warning: logger was loaded from the standard library, but will 
no longer be part of the default gems starting from Ruby 4.0.0.

Root Cause

The logger gem is currently a default gem in Ruby (included automatically), but starting with Ruby 4.0, it will become a regular gem that must be explicitly installed.

The excon gem (dependency of docker-api) uses logger, which triggers this warning in Ruby 3.4+ as a heads-up about the upcoming change.

Solution

Explicitly add logger to Gemfile:

gem 'logger'

Benefits

Silences deprecation warning - Clean test output
Forward compatibility - Ready for Ruby 4.0
Explicit dependency - Makes dependency clear rather than implicit
No breaking changes - Works with all Ruby versions

Testing

✅ All tests pass without warnings
✅ No behavioral changes
✅ Compatible with Ruby 3.4 and future versions

Ruby 3.4+ warns that logger will no longer be a default gem in Ruby 4.0.
Explicitly adding it to Gemfile prevents this warning:

'warning: logger was loaded from the standard library, but will
no longer be part of the default gems starting from Ruby 4.0.0.'

The logger gem is a dependency of excon (used by docker-api), but
it's being transitioned from a default gem to a regular gem.
By explicitly including it, we:
- Silence the deprecation warning
- Ensure forward compatibility with Ruby 4.0
- Make the dependency explicit rather than implicit

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@chorrell chorrell merged commit a7589d3 into main Feb 10, 2026
1 check passed
@chorrell chorrell deleted the fix-logger-deprecation-warning branch February 10, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant