roidrage/lograge

Simpler way to remove all log subscribers.

ioquatix opened this issue · 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.

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

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

owst commented

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