src/ThreadPrintStream.java
public static void replaceSystemErr() {

        // Save the existing System.out
        PrintStream console = System.err;

        // Create a ThreadPrintStream and install it as System.out
        ThreadPrintStream threadErr = new ThreadPrintStream();
        System.setErr(threadErr);

        // Use the original System.out as the current thread's System.out
        threadErr.setThreadOut(console);
    }
/** Changes System.err to a ThreadPrintStream which will
     * send output to a separate streem for each thread. */
Changes System.err to a ThreadPrintStream which will
send output to a separate streem for each thread.
Changes System . err to a ThreadPrintStream which will send output to a separate streem for each thread .
public static void replaceSystemErr() {
        PrintStream console = System.err;
        ThreadPrintStream threadErr = new ThreadPrintStream();
        System.setErr(threadErr);
        threadErr.setThreadOut(console);
    }
public static void replaceSystemErr ( ) { PrintStream console = System . err ; ThreadPrintStream threadErr = new ThreadPrintStream ( ) ; System . setErr ( threadErr ) ; threadErr . setThreadOut ( console ) ; }
Changes System.err to a ThreadPrintStream which will
 send output to a separate streem for each thread.
Changes System . err to a ThreadPrintStream which will send output to a separate streem for each thread .
// Save the existing System.out // Create a ThreadPrintStream and install it as System.out // Use the original System.out as the current thread's System.out