Skip to content

Conversation

@takahashim
Copy link

Describe the change

This PR fixes an issue in Ruby 3.4 where TTY::Logger fails to display the correct log type name.

Why are we doing this?

Suppose we run the following code:

require 'tty-logger'

logger = TTY::Logger.new
logger.success "Deployed successfully"

in Ruby 3.3.5:

✔ success Deployed successfully    

in Ruby 3.4.1:

ℹ info    Deployed successfully    

This is likely due to changes in the behavior of Thread::Backtrace::Location returned by caller_locations.
https://github.com/ruby/ruby/blob/master/doc/NEWS/NEWS-3.4.0.md#compatibility-issues

Benefits

We can use TTY::Logger in Ruby 3.4.

Drawbacks

I hope nothing.

Requirements

  • Tests written & passing locally?
  • Code style checked?
  • Rebased with master branch?
  • Documentation updated?
  • Changelog updated?

@takahashim takahashim marked this pull request as ready for review December 31, 2024 11:17
@stillhart
Copy link

I just had the same issue. Very interesting failure mode.

Ruby 3.3.2

image

vs

Ruby 3.4.1

image

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.

2 participants