|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sodius.mdw.core.util.log.SystemStream
public final class SystemStream
Provides methods to redirect System.out and System.err streams to a logger.
For example, you can redirect System stream messages into a file using the following code :
FileLogger fileLogger = new FileLogger(new File("myFile.log"));
SystemStream.connect(fileLogger);
workbench.getConfiguration().setLogger(fileLogger);
This class cannot be instantiated or subclassed by clients.
| Method Summary | |
|---|---|
static void |
connect(Logger logger)
Redirects System.out and System.err streams to the specified logger. |
static void |
disconnect()
Restores the original streams to System.out and System.err. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void connect(Logger logger)
System.out and System.err streams to the specified logger.
When a logger is connected to system streams,
any call to System.out.print() will be redirected to the logger info() method,
and any call to System.err.print() will be redirected to the logger error() method.
Additionally, the messages will still be written into the original System.out and System.err streams
logger - the logger which should receive any information written in System.out and System.err streams.public static void disconnect()
System.out and System.err.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||