This is way more low touch than trying to refactor code to make it “testable”.
Many a time, this leads to awkward APIs, encapsulation violations and more.
Every test instantiates it’s own logger and passes it to the code being tested. The code will do its thing and 1) result a result or an error 2) emit telemetry.
Just check the telemetry output instead. You can maintain clean public APIs that expose just enough to the clients.
Super helpful when debugging to have confidence that the data you’re looking at is correct.
More focused “local stress testing” can help shake out a number of bugs in the hot/critical path of the codebase.
It can run as a part of your test harness in CI, without having to make a ton of investment in setting up an integration testing infrastructure.
But purely in terms of testing code functionality, more than small functions to make code “unit testable”, instrumentation APIs can be leveraged a lot more and a lot better.