ubiware.util
Class Logger

java.lang.Object
  extended by ubiware.util.Logger

public class Logger
extends java.lang.Object

Implementation of a logger which catches the output written to the streams returned by getStandardError and getStandardOut and writes this to the interceptor specified.

Use: (example from UbiwareAgent)

 FileOutputStream fout;
 fout = new FileOutputStream("lastLog_" + this.here().getName() + ".txt");
 Logger log = new Logger(System.out, System.err, fout);
 System.setOut(log.getStandardOut());
 System.setErr(log.getStandardError());
 
Writes everything which gets printed to either system.out or system.err first to the file.

modified by Michael Cochez for UBIWARE project


Constructor Summary
Logger(java.io.OutputStream oldStdOut, java.io.OutputStream oldStdErr, java.io.OutputStream interceptor)
           
 
Method Summary
 java.io.PrintStream getStandardError()
           
 java.io.PrintStream getStandardOut()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Logger

public Logger(java.io.OutputStream oldStdOut,
              java.io.OutputStream oldStdErr,
              java.io.OutputStream interceptor)
Method Detail

getStandardOut

public java.io.PrintStream getStandardOut()

getStandardError

public java.io.PrintStream getStandardError()