Console log when test fails

Hello, I’m trying to debug why something fails, the test basicly checks for a string within the body, however It is a bit frustrating navigating the console, trying to figure out which test failed out of hundreds.

So, can I incorporate somehow to have console.log(pm.response.json()) or even a simple console.log(“here”) for only when the test FAILS. if the test fails