kiwi.ui
Class ConsoleAdapter
java.lang.Object
kiwi.ui.ConsoleAdapter
- public class ConsoleAdapter
- extends java.lang.Object
Adapter for using a logging endpoint with the standard output stream.
This class allows an arbitrary logging endpoint to be connected (via an
OutputLoop
) to the standard output stream,
System.out
. The class starts a separate thread which reads
messages from the pipe and writes them to the logging endpoint. Message
severity is specified using a message prefix; "warning:", "status:",
"info:", or "error:". The default severity is STATUS
. For
example:
System.out.println("info:Program started.");
will log the message "Program started." as an INFO
message.
- Author:
- Mark Lindner, PING Software Group
- See Also:
ConsoleFrame
,
kiwi.io.OutputLoop
Method Summary |
private void |
_run()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private LoggingEndpoint log
pipe
private OutputLoop pipe
reader
private java.io.BufferedReader reader
thread
private java.lang.Thread thread
ConsoleAdapter
public ConsoleAdapter(LoggingEndpoint log)
throws java.io.IOException
- Construct a new
ConsoleAdapter
for the specified logging
endpoint.
- Parameters:
log
- The LoggingEndpoint
to use.
- Throws:
java.io.IOException
- If the output loop could not be created.
_run
private void _run()