zormandi / logcraft-sidekiq

A structured logging solution for Sidekiq, using Logcraft.
MIT License
3 stars 3 forks source link

Accept config param for error handlers #3

Closed wfarr closed 3 months ago

wfarr commented 4 months ago

Sidekiq introduced a deprecation warning in sidekiq/sideki#6051 for an upcoming change in Sidekiq 8.0.

Configs are no longer included in the context param, but are instead provided by a new dedicated param.

In an attempt to maintain backwards compatibility, I've opted to make this third param optional with a default of nil, which should work on older versions of sidekiq (which do not have logical checks around arity of the handler and simply call handler.call(ex, ctx) while addressing the deprecation warning on newer versions of Sidekiq.

zormandi commented 3 months ago

Ah, the CI is failing because this PR was based off the branch that wasn't compatible with Sidekiq 7.3. Anyway, I quickly added the code myself (plus a test) and released a new version with the fix. Thanks a lot again for your contribution!