List of usage examples for weka.core Tee Tee
public Tee(PrintStream def)
From source file:jjj.asap.sas.util.Job.java
License:Open Source License
/** * Init job/*w w w . ja v a 2 s .c om*/ */ private void init(final String jobName) { // job information final int jobNumber = getNextJobNumber(jobName); this.jobId = jobName + "-" + jobNumber; final String logFileName = getLogFile(this.jobId); // setup logging and console PrintStream log; try { log = new PrintStream(new FileOutputStream(logFileName), true); } catch (FileNotFoundException e) { throw new RuntimeException(logFileName, e); } Tee stdout = new Tee(System.out); stdout.add(log, true); System.setOut(stdout); Tee stderr = new Tee(System.err); stderr.add(log, true); System.setErr(stderr); }