So one of the tech debt issues that my team faces is that while tests are running, I will occasionally see exceptions being logged as part of the output of running the tests. The problem is that sometimes these exceptions are supposed to happen (for example when I am testing failure scenarios) but it makes it hard to tell when watching the logs whether something unexpected happened and I could be missing an issue that I haven't tested.
When I talk about exceptions being logged, I'm referring to the fact that libraries I use may log exceptions as well as throw them, so even though I catch the exception in my test, I still get the log output which clutters up my log.
I was wondering if anyone had come up with a way to filter the log output so that I would only see error output that isn't expected as part of the test. I understand this is a pretty difficult thing to do, but perhaps someone has come up with a method for doing this.