tty-logger
tty-logger copied to clipboard
Fix to show the name of log type correctly in Ruby 3.4
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
- [x] Tests written & passing locally?
- [x] Code style checked?
- [x] Rebased with
masterbranch? - [x] Documentation updated?
- [x] Changelog updated?
I just had the same issue. Very interesting failure mode.
Ruby 3.3.2
vs
Ruby 3.4.1