edu.mit.util
Class DebugWindowAppender

java.lang.Object
  |
  +--org.apache.log4j.AppenderSkeleton
        |
        +--edu.mit.util.DebugWindowAppender
All Implemented Interfaces:
org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

public class DebugWindowAppender
extends org.apache.log4j.AppenderSkeleton


Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Constructor Summary
DebugWindowAppender()
          This default constructor does nothing.
DebugWindowAppender(org.apache.log4j.Layout layout)
          Instantiate a DebugWindowAppender and set the output destination to DebugWindow.
 
Method Summary
 void activateOptions()
          Does nothing.
 void append(org.apache.log4j.spi.LoggingEvent event)
          This method is called by the AppenderSkeleton.doAppend(org.apache.log4j.spi.LoggingEvent) method.
protected  boolean checkEntryConditions()
          This method determines if there is a sense in attempting to append.
 void close()
          Close this appender instance.
protected  void insert(String name, String text)
           
 boolean requiresLayout()
          The WriterAppender requires a layout.
 void setErrorHandler(org.apache.log4j.spi.ErrorHandler eh)
          Set the ErrorHandler for this WriterAppender and also the underlying QuietWriter if any.
protected  void subAppend(org.apache.log4j.spi.LoggingEvent event)
          Actual writing occurs here.
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugWindowAppender

public DebugWindowAppender()
This default constructor does nothing.

DebugWindowAppender

public DebugWindowAppender(org.apache.log4j.Layout layout)
Instantiate a DebugWindowAppender and set the output destination to DebugWindow.
Method Detail

activateOptions

public void activateOptions()
Does nothing.
Overrides:
activateOptions in class org.apache.log4j.AppenderSkeleton

append

public void append(org.apache.log4j.spi.LoggingEvent event)
This method is called by the AppenderSkeleton.doAppend(org.apache.log4j.spi.LoggingEvent) method.

The format of the output will depend on this appender's layout.

Overrides:
append in class org.apache.log4j.AppenderSkeleton

checkEntryConditions

protected boolean checkEntryConditions()
This method determines if there is a sense in attempting to append.

It checks whether there is a set output target and also if there is a set layout. If these checks fail, then the boolean value false is returned.


close

public void close()
Close this appender instance. The underlying stream or writer is also closed.

Closed appenders cannot be reused.

Overrides:
close in class org.apache.log4j.AppenderSkeleton
Since:
0.8.4 *
See Also:
#setWriter

setErrorHandler

public void setErrorHandler(org.apache.log4j.spi.ErrorHandler eh)
Set the ErrorHandler for this WriterAppender and also the underlying QuietWriter if any.
Overrides:
setErrorHandler in class org.apache.log4j.AppenderSkeleton

subAppend

protected void subAppend(org.apache.log4j.spi.LoggingEvent event)
Actual writing occurs here.

Most subclasses of WriterAppender will need to override this method.


requiresLayout

public boolean requiresLayout()
The WriterAppender requires a layout. Hence, this method returns true.
Overrides:
requiresLayout in class org.apache.log4j.AppenderSkeleton

insert

protected void insert(String name,
                      String text)