I am very new at programming so my apologies in advance if my question is a bit primary.
I have a piece of JAVA code (more than 10,000 lines) and it has hundreds of System.out.println("blabla");
and I need to save them in a .txt file. I cannot go through all of them and change the code so I was wondering if there is any way that I can add some lins of codes then run the program and finally save the logs when that Java program is finished.