ubiware.util
Class Logger
java.lang.Object
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Logger
public Logger(java.io.OutputStream oldStdOut,
java.io.OutputStream oldStdErr,
java.io.OutputStream interceptor)
getStandardOut
public java.io.PrintStream getStandardOut()
getStandardError
public java.io.PrintStream getStandardError()