org.jcoderz.commons.logging
Class NestedLineFormat

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

public final class NestedLineFormat
extends ContinuationLineFormat

Formats and parses log lines for nested messages.


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
NestedLineFormat()
          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 either a LogRecord or a Loggable as nested message.
 void parse(StringBuffer sb, LogFileEntry entry)
          The common interface for all log line formatters.
 
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

NestedLineFormat

public NestedLineFormat()
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 either a LogRecord or a Loggable as nested message. 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 - Unused, might be null.
parameter - Gives the cause of the message on top of this and is the message text to be formatted by this.

parse

public void parse(StringBuffer sb,
                  LogFileEntry entry)
           throws ParseException
The common interface for all log line formatters. A log line is parsed and the data being retrieved is set within 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.