if (originalSystemErr != null) {
RuntimeException e = new RuntimeException("recursivecall");
originalSystemErr.println("recursive call into SystemOutandErrhandler");
e.printStackTrace(originalSystemErr);
return;
}
LoggingByteArrayOutputStream buf = new LoggingByteArrayOutputStream();
// Initialise logger and set new systemout
seLogger = java.util.logging.Logger.getLogger(SYSTEMERR_LOGGER);
// seLogger = LogDomains.getLogger(LogDomains.SYSTEMERR_LOGGER, false);
buf.setLogger(seLogger, errLogLevel);
originalSystemErr = System.err;
lerr = (new LoggingPrintStream(buf));
lerr.setLogger(seLogger);
System.setErr(lerr);
buf = new LoggingByteArrayOutputStream();
// Initialise logger and set new systemout
soLogger = java.util.logging.Logger.getLogger(SYSTEMOUT_LOGGER);
buf.setLogger(soLogger, outLogLevel);
lout = (new LoggingPrintStream(buf));
lout.setLogger(soLogger);
System.setOut(lout);
lineSeparator = (String) java.security.AccessController.doPrivileged(
new sun.security.action.GetPropertyAction("line.separator"));
lineSeparatorSize = lineSeparator.length();