try
{
PrintStream wrapperOut = (PrintStream) new CyclicBufferFilePrintStream(fOut);
TeeOutputStream newOut = (TeeOutputStream) new TeeOutputStream();
newOut.connect(wrapperOut);
// pipe output to console only if it is visible
if (visible)
newOut.connect(System.out);
_outStream = wrapperOut;
System.setOut(new PrintStream(newOut));