launchdarkly / ruby-server-sdk

LaunchDarkly Server-side SDK for Ruby
https://docs.launchdarkly.com/sdk/server-side/ruby
Other
34 stars 50 forks source link

fix: Do not assume Rails.logger exists simply because it responds to the method #258

Closed codeodor closed 5 months ago

codeodor commented 5 months ago

Requirements

I did not validate it against all platform versions, but rather than use something like present? or try or &. I just used the ruby idiom for checking nil/false by using the object at the end, like && object

Have you considered putting that last requirement into the CI's hands so that it might become unnecessary?

Related issues

None that I am aware of.

Describe the solution you've provided

The code previously checked that Rails responded to logger and if it did, assumes there is actually a logger present, which is not always the case. This leaves LD with a nil value for logger which causes the application to crash.

Describe alternatives you've considered

I did not consider any alternatives.

Additional context

None.

keelerm84 commented 5 months ago

Thank you for this contribution!

codeodor commented 5 months ago

My pleasure!