How to keep sysout and syserr streams from intermixing?

后端 未结 2 1569
后悔当初
后悔当初 2020-12-21 06:40

In my code base is the (very simplified) following:

public static void main (String[] args) {
   System.out.println(\"Starting application\");
   try {
              


        
2条回答
  •  南方客
    南方客 (楼主)
    2020-12-21 07:20

    Call e.printStackTrace(System.out);. Or, if you need it for debugging only, you can separate the process' output and error from the command line: .... 1>output.log 2>error.log

提交回复
热议问题