Class ThreadLocalPrintStream

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
com.martiansoftware.nailgun.ThreadLocalPrintStream
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

class ThreadLocalPrintStream extends PrintStream
The class name is pretty descriptive. This creates a PrintStream much like a FilterOutputStream, but with the wrapped PrintStream being local to the current Thread. By setting System.out to a ThreadLocalPrintStream, different Threads can write to different PrintStreams simply by using System.out. Of course, the init() method must be called by the Thread that wishes to use the wrapped stream.