edu.mit.simile.tracer
Class Tracer

java.lang.Object
  extended by org.apache.log4j.Layout
      extended by edu.mit.simile.tracer.Tracer
All Implemented Interfaces:
org.apache.log4j.spi.OptionHandler

public class Tracer
extends org.apache.log4j.Layout

This is a special Log4j log formatter that is capable of reacting on special log messages and 'indent' the logs accordingly. This is very useful to visually inspect a debug log and see what calls what. An example of logs are "> method()" and "< method()" where > and < are used to indicate respectively "entering" and "exiting".


Field Summary
protected  StringBuffer buf
           
protected  Calendar calendar
           
protected static int CONTEXT_SIZE
           
protected  int indentation
           
protected static long MAX_DELTA
           
protected  long previousTime
           
 
Fields inherited from class org.apache.log4j.Layout
LINE_SEP, LINE_SEP_LEN
 
Constructor Summary
Tracer()
           
 
Method Summary
 void activateOptions()
           
 String format(org.apache.log4j.spi.LoggingEvent event)
           
 boolean ignoresThrowable()
           
 
Methods inherited from class org.apache.log4j.Layout
getContentType, getFooter, getHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTEXT_SIZE

protected static final int CONTEXT_SIZE
See Also:
Constant Field Values

MAX_DELTA

protected static final long MAX_DELTA
See Also:
Constant Field Values

buf

protected final StringBuffer buf

calendar

protected Calendar calendar

previousTime

protected long previousTime

indentation

protected int indentation
Constructor Detail

Tracer

public Tracer()
Method Detail

activateOptions

public void activateOptions()

format

public String format(org.apache.log4j.spi.LoggingEvent event)
Specified by:
format in class org.apache.log4j.Layout

ignoresThrowable

public boolean ignoresThrowable()
Specified by:
ignoresThrowable in class org.apache.log4j.Layout


Copyright © 2011. All Rights Reserved.