Add check for piping into Logger functions
Calls into Logger can be purged when :compile_time_purge_matching is enabled in the Logger configuration causing unexpected behavior in releases.
See https://x.com/elixirboy/status/1770336803280556486 and https://bsky.app/profile/hauleth.dev/post/3lhguoqmpos2i for examples of this happening to people.
Hi, thx for putting this together.
But please don't link several social media posts on different networks (which not everybody might have an account for) instead of writing a simple rationale. 🙂
It is also bad for reviewers to come back to something like this and then having to open multiple tabs again, just to re-familiarize themselves. 👍
Thanks @rrrene the description was not intended to be a rationale, but to argue the merit of the check. The rationale is in the description of the check. I understand if that wasn't clear. I added part of the check description to the PR description 👍
Hi, thx again for this. Unfortunately, I am closing it as I really never got why this check should be included as a standard check in Credo (the 1-sentence-explanation did not make it any clearer).
If you disagree, please re-open and elaborate! :+1:
Which single sentence are you referring to? The explanation I wrote is 3 sentences:
Calls into Logger can be purged when `:compile_time_purge_matching` is enabled in
the Logger configuration. This will remove the entire pipeline.
Use |> tap(&Logger.info(&1)) instead.