Closed iMacTia closed 2 years ago
LOL I've seen this for years and just never cared enough to fix it. Thanks for all your help improving Deimos!
Thank you @dorner as usual for the super-quick turnaround π! I'm currently working on a project with Deimos at my place and really happy to contribute back anytime I find something that might be improved π.
I see you're prepping a 1.12.6 release, that would be really great π !
And it's already out! Thank you a lot π !
Description
This PR fixes an issue where the initialization of the 2 mock providers would cause unwanted logs to be sent to STDOUT. This is because the default values for
metrics
andtracer
currently call the#initialize
method in bothMetrics::Mock
andTracing::Mock
while the Deimos class is loaded.There's currently no way to avoid that, including specifying a custom value for these settings.
This PR also includes a new
bin/console
script which allows developers to load up an IRB console with the localdeimos
gem loaded. This is a pretty common script (it's autogenerated in new gems nowadays), useful for testing uncommitted changes. It's been added in this PR because it makes it really easy to see the problem.Type of change
How Has This Been Tested?
Since this issue happens when the
Deimos
is first loaded, it wasn't possible to write an RSpec test for this change. Instead, the newbin/console
makes demonstrating this issue very easy.If you checkout this PR, revert
lib/deimos/configuration.rb
to it's previous state, and then runbin/console
, you'll see the following:As you can see, the two mock providers log to STDOUT as a result of
require 'deimos'
. This happens even if you callDeimos.configure
and pass a custom value formetrics
andtracer
.If you now apply the changes to
lib/deimos/configuration.rb
included in this PR and runbin/console
again, that won't happen anymore:Checklist: