I am using SLF4J SimpleLogger for unit tests. Due to external factors, it would be difficult to change magazine providers.
The test class captures the logger from its own structure for recording errors. The problem is that when I test the error condition, I end up with a big scary error message in the test logs, although the test passes. I think this is a bad thing.
When I used Log4J, I could grab the logger for the tested class and change its level to OFF before running the test, and then change it. It seems that SimpleLogger does not have an OFF level, so the quietest value will be ERROR, which, of course, is logged when called error().
Is there a better way to do this? Is it possible?
source
share