Is it somehow possible to print both to file and console?
If I make
PrintStream fileStream = new PrintStream(logPath);
System.setOut(fileStream);
it will only print all System.out.println() to file, but I also need to see it in console.
Is it somehow possible to print both to file and console?
If I make
PrintStream fileStream = new PrintStream(logPath);
System.setOut(fileStream);
it will only print all System.out.println() to file, but I also need to see it in console.
Yes it is.You just need to write your file using Buffer writers and use S.O.P at the end of the function or according to the things you want to print to your console.