org.formaria.log
Class QueueLogWriter

java.lang.Object
  extended by org.formaria.log.QueueLogWriter
All Implemented Interfaces:
java.lang.Runnable, LogWriter

public class QueueLogWriter
extends java.lang.Object
implements LogWriter, java.lang.Runnable

A background log writer using a queue to write to the output stream


Field Summary
protected  java.util.concurrent.BlockingQueue msqQ
           
protected  boolean useErrorStream
           
 
Constructor Summary
QueueLogWriter()
          Construct a new writer
 
Method Summary
 void run()
           
 void setStream(boolean isError)
          Set the use of the error stream
 void writeLine(java.lang.String message)
          Write a line to the log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

msqQ

protected java.util.concurrent.BlockingQueue msqQ

useErrorStream

protected boolean useErrorStream
Constructor Detail

QueueLogWriter

public QueueLogWriter()
Construct a new writer

Method Detail

setStream

public void setStream(boolean isError)
Set the use of the error stream

Specified by:
setStream in interface LogWriter

writeLine

public void writeLine(java.lang.String message)
Write a line to the log

Specified by:
writeLine in interface LogWriter
Parameters:
message - the line to write

run

public void run()
Specified by:
run in interface java.lang.Runnable