There seems to be two trends on this topic:
- Some answers (such as this one) suggest unit tests should not log anything.
- Some questions and answers (such as this one) suggest different logging techniques and formats used in unit tests.
Should unit tests log what they do? Would those additional informations be helpful in the unit test reports? Or should unit tests be silent as long as they don’t fail?
My question targets Java unit tests, but input from programmers in other languages could be interesting as well.
I’ve used both quiet and verbose logging during unit tests, and I personally prefer it when each test outputs a single line with test name and how it went. I find it more appealing when I can tell what is going on, though I can’t say it has any real impact on my work.
If you run from console, colored output is a plus, I think.