Use direct caller in flattened output even if its callsite is blacklisted #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Similar to #51, but for a different reason and rewritten due to not having an entity blacklist anymore.
Problem
In the flattened output we were trying to mimic the behaviour we had before where we got the flattened output from the non-flattened output. That behaviour worked by keeping a stack of previous calls that is pushed for each call and popped for each return, so we could get the caller entity and method from the parent call. Since the non-flattened output would exclude blacklisted calls, it would end up getting the parent non-blacklisted caller info rather than the direct caller info.
The problem with that approach for the flattened output is that we are actually filtering based on the call site path, so if the parent call was blacklisted then that means the caller's caller was blacklisted, which isn't relevant for the current call.
Solution
We already return without logging if the call came from a blacklisted file path, so we just use the caller's entity and method unconditionally in the flattened output.
bin/fmt
was successfully run