Commit 19af8f5
committed
[NO-TICKET] RFC: Add
**What does this PR do?**
This PR declares a dependency from the `datadog` gem to the `logger`
gem.
While every PR is an RFC, I explicitly marked this one as such since
adding a new dependency should never be done lightly.
**Motivation:**
This is needed to avoid a warning:
> lib/datadog/core/configuration/settings.rb:3: warning: logger was
> loaded from the standard library, but will no longer be part of the
> default gems starting from Ruby 3.5.0.
> You can add logger to your Gemfile or gemspec to silence this warning.
**Additional Notes:**
`logger` is just the latest in a long line of gems that have been
refactored out in this way. See
ruby/ruby@d7e558e
and https://stdgems.org/ (not yet updated for 3.5 as of this writing).
While in the past we've avoided adding extra dependencies due to this
extraction work, I think this one does make sense to add:
1. It's supported on every Ruby version we currently support (>= 2.5)
2. It's not a small amount of code to shed/rewrite. And on the other
side, I don't see a strong reason for embedding instead of depending
on it.
We're getting warnings for two more gems: `ostruct` and `benchmark`.
From our internal discussions, we can probably get rid of our usage
of them, rather than promote them to a dependency, so that's why I
did not touch those warnings in this PR.
**How to test the change?**
The following script can be used (on Ruby 3.4 and above) to trigger
the warning, and to confirm it's gone once `logger` is added as
a dependency:
```ruby
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'datadog', path: '.'
end
puts RUBY_DESCRIPTION
require 'datadog'
puts Datadog::VERSION::STRING
```
Make sure to run with just `ruby example.rb` and not with
`bundle exec`.logger gem as dependency to prepare for future Ruby versions1 parent ee94c0e commit 19af8f5
File tree
4 files changed
+17
-1
lines changed- .gitlab
- lib-injection
- spec/datadog
4 files changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
74 | 84 | | |
75 | 85 | | |
76 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
| 185 | + | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
| 107 | + | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| 114 | + | |
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
| |||
0 commit comments