Redirect System.out.println to log

前端 未结 5 1433
孤城傲影
孤城傲影 2021-01-11 15:51

In my project test suite there is big usage of

System.out.println 

I\'m trying to redirect these output to log file (through configuration

5条回答
  •  庸人自扰
    2021-01-11 16:43

    I think you can use System.setOut(PrintStream) to set your output to a file output stream. Then you can put this line in your BeforeClass method. I like to use a BaseTest class and put this line of code in the beforeclass method of that class. Then make all test cases extend this cclass.

提交回复
热议问题