I am doing a Java application, which will use swing user interface. It will ask user to specify some settings, by filling in forms, and then process them and generate some files in the ./output/ directory.
During development process, I’d like to output some technical information in console, using System.out.println() method.
Do I need to remove all these console outputs when I’ll finish development?
If yes, what is the best way to display debug information during development process to easily remove it before production?
Maybe I should use only JUnit tests for debugging purposes? I’ve just started with it, so I have vague idea of its capabilities.
If you’re not going to use a specialised debugging framework it could be as easy as:
The Debugger class just encapsulates the println calls (like this):
That way when you want to go to production, or you can modify the behavior of your debugging (or disable it) by changing one line in a class.