lograge icon indicating copy to clipboard operation
lograge copied to clipboard

Simpler way to remove all log subscribers.

Open ioquatix opened this issue 1 year ago • 3 comments

Not sure if this has been considered, but what about:

ActiveSupport::Notifications.notifier = ActiveSupport::Notifications::Fanout.new

This clears out all subscriptions and is probably faster and more robust than the existing implementation.

ioquatix avatar Aug 02 '23 03:08 ioquatix

Nice. Thanks for the heads up. Do you want to open a PR or I can pick it up?

benlovell avatar Oct 10 '23 18:10 benlovell

I was not planning on opening a PR but I can if that’s helpful.

ioquatix avatar Oct 10 '23 20:10 ioquatix

I agree that the existing implementation isn't particularly robust (see #386 for example), but wouldn't this also unsubscribe unrelated listeners, for example the one powering a gem such as https://github.com/steventen/sql_tracker

owst avatar Jan 24 '24 23:01 owst