org.jcoderz.commons.logging
Class StackTraceFormat

java.lang.Object
  extended by org.jcoderz.commons.logging.LogLineFormat
      extended by org.jcoderz.commons.logging.ContinuationLineFormat
          extended by org.jcoderz.commons.logging.StackTraceFormat

public final class StackTraceFormat
extends ContinuationLineFormat

This class is used for formatting the stack trace of a Throwable or for parsing one line of stack trace.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jcoderz.commons.logging.LogLineFormat
LogLineFormat.LogLineType
 
Field Summary
 
Fields inherited from class org.jcoderz.commons.logging.ContinuationLineFormat
NUMBER_OF_PARAMETERS
 
Fields inherited from class org.jcoderz.commons.logging.LogLineFormat
EMPTY_FORMATTERS, ERROR_MESSAGE, EXCEPTION_MESSAGE, LOG_MESSAGE, NESTED_MESSAGE, PARAMETER_LINE, SOURCECLASS_INDEX, SOURCEMETHOD_INDEX, STACKTRACE_MESSAGE, TRACE_MESSAGE
 
Constructor Summary
StackTraceFormat()
          Creates a new instance of this and initializes the message format.
 
Method Summary
 void format(StringBuffer sb, LogRecord record, Loggable loggable, List trackingIdSequence, Throwable thrown, Object parameter)
          Formats a Throwable.
 void parse(StringBuffer sb, LogFileEntry entry)
          Parses one line of log data and sets the data in the supplied LogFileEntry.
 
Methods inherited from class org.jcoderz.commons.logging.ContinuationLineFormat
basicFormat, basicParse, getBasicFormatList, getThreadId, getTrackingIds, setThreadId, setTrackingIds
 
Methods inherited from class org.jcoderz.commons.logging.LogLineFormat
format, getBusinessImpactFormat, getCategoryFormat, getInstanceIdFormat, getLoggerLevelFormat, getLogLineType, getLogSource, getMessageSymbolFormat, getNodeIdFormat, getParameter, getThreadIdFormat, getThreadNameFormat, getTimestampFormat, getTrackingNumberFormat, parse, setFormats, setParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackTraceFormat

public StackTraceFormat()
Creates a new instance of this and initializes the message format.

Method Detail

format

public void format(StringBuffer sb,
                   LogRecord record,
                   Loggable loggable,
                   List trackingIdSequence,
                   Throwable thrown,
                   Object parameter)
Formats a Throwable. Append a line feed after the data has been formatted into the StringBuffer.

Specified by:
format in class LogLineFormat
Parameters:
sb - The StringBuffer where to append the formatted data.
record - The LogRecord to format, if loggable is not null, this is unused and might be null.
loggable - The Loggable to format, might be null, but then record must not be null.
trackingIdSequence - The sequence of contributing tracking ids.
thrown - The Throwable to format.
parameter - The Throwable containing thrown as cause. Might be null, if no such. Must be instance of Throwable if not null.

parse

public void parse(StringBuffer sb,
                  LogFileEntry entry)
           throws ParseException
Parses one line of log data and sets the data in the supplied LogFileEntry.

Specified by:
parse in class LogLineFormat
Parameters:
sb - The StringBuffer containing the log line to parse from the current position to the end.
entry - The LogFileEntry which gets the data being parsed.
Throws:
ParseException - if an error occurs parsing the log line.


Copyright 2007 The jCoderZ Project.