Java: synchronizing standard out and standard error

后端 未结 6 1160
孤城傲影
孤城傲影 2020-12-03 18:38

I have a strange problem and it would be nice if I could solve it. For the debugging purposes (and some other things, as well) I\'m writing a log of a console Java applicati

6条回答
  •  醉梦人生
    2020-12-03 18:58

    public class Util
    
        synchronized public static void printToOut(...)
            out.print(...)
    
        synchronized public static void printToErr(...)
            err.print(...)
    

提交回复
热议问题