Disable System.err

前端 未结 4 2181
没有蜡笔的小新
没有蜡笔的小新 2021-02-18 22:58

Is there a way to set the stream System.err so everything written to it is ignored? (i.e. discarded not outputted)

4条回答
  •  [愿得一人]
    2021-02-18 23:30

    You can use System.setErr() to give it a PrintStream which doesn't do anything.

    See @dogbane's example for the code.

提交回复
热议问题