|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Interface implemented by any user-defined objects to capture KineticFusion log events. Currently all log messages from KineticFusion are emitted as text strings. To add file logging to all KineticFusion processing you must write a class that implements the LoggingAppender interface. For example, to write a simple file logging class:
import java.io.IOException;
import java.io.Writer;
public class WriterAppender implements LoggingAppender {
private Writer myWriter;
public WriterAppender(Writer writer)
{
super();
myWriter = writer;
}
public void append(String text)
{
try {
myWriter.write( text);
myWriter.flush();
}
catch (IOException e) {
e.printStackTrace();
}
}
public void close()
{
try {
myWriter.close();
}
catch (IOException e) {
e.printStackTrace();
}
}
}
This can be used in another class as:
... RVMLStreamHandler handler = new RVMLStreamHandler(); WriterAppender appender = new WriterAppender( new FileWriter( "myLogFile.txt") ); handler.addLoggingAppender( appender ); ...
| Method Summary | |
void |
append(java.lang.String text)
Append text to the log |
void |
close()
Close the appender |
| Method Detail |
public void append(java.lang.String text)
text - public void close()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||