charkost / prosopite

:mag: Rails N+1 queries auto-detection with zero false positives / false negatives
Apache License 2.0
1.53k stars 46 forks source link

Extend custom logger to allow taking the notifications directly and generate it's own string. #57

Open technicalpickles opened 1 year ago

technicalpickles commented 1 year ago

We have a custom logger, but in order to inspect the callstack and customize the message, we end up throwing out the notification_str and reaching into Thread.current[:prosopite_notifications] directly to get it.

We also have to do our own filtering and cleaning because they haven't been cleaned yet.

I'm proposing this change to let the customer logger take the notifications keyword that gets the notifications OR a single argument that is the generated string. In support of that, I clean the callstacks before calling the custom logger.

cc @geshwho who wrote our custom logger. Hoping we can refactor it to be smaller with these changes 😁