Example usage for weka.core Tee Tee

List of usage examples for weka.core Tee Tee

Introduction

In this page you can find the example usage for weka.core Tee Tee.

Prototype

public Tee(PrintStream def) 

Source Link

Document

initializes the object with the given default printstream, e.g., System.out.

Usage

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);
}