com.sap.tc.logging
Class ListFormatter
java.lang.Object
|
+--com.sap.tc.logging.Formatter
|
+--com.sap.tc.logging.ListFormatter
- Direct Known Subclasses:
- PerfFormatter
- public class ListFormatter
- extends Formatter
Formats log records as simple hash-separated columns.
|
Method Summary |
static boolean |
compareField(int fieldIndex,
int operater,
java.lang.String valueA,
java.lang.String valueB)
|
java.lang.String |
format(LogRecord rec)
Formats a log record which is then ready to be written to a log. |
static java.util.Map |
getFields()
|
boolean |
isCompleteMessage(int messageSize,
byte[] message,
int delimiterSize,
int[] delimiter)
|
boolean |
isCompleteMessage(java.lang.String msg)
Determine if the message string reaches the valid end(delimiter) of a
complete message record, according to the format defined by the formatter.
|
boolean |
isParsable()
Return true if this formatter supports message parsing formatted with this
formatter. |
boolean |
isStartMessage(java.lang.String msg)
Determine if the message string has a valid start of message record
Prerequisite: parameter 'msg' is supposed to be a string of at least 1
complete line from logfile |
boolean |
isStartMsg(int messageSize,
byte[] message)
|
LogRecord |
parseMsg(byte[] msgChunk)
|
LogRecord |
parseMsg(java.lang.String completeMsgData)
Parse message formatted by ListFormatter, current version 1.5.
|
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
F_NAME_DATE_TIME
public static final java.lang.String F_NAME_DATE_TIME
F_NAME_SOURCE
public static final java.lang.String F_NAME_SOURCE
F_NAME_APPLICATION
public static final java.lang.String F_NAME_APPLICATION
F_NAME_LOCATION
public static final java.lang.String F_NAME_LOCATION
F_NAME_USER
public static final java.lang.String F_NAME_USER
F_NAME_SESSION
public static final java.lang.String F_NAME_SESSION
F_NAME_TRANSACTION
public static final java.lang.String F_NAME_TRANSACTION
F_NAME_DSR_COMPONENT
public static final java.lang.String F_NAME_DSR_COMPONENT
F_NAME_DSR_USER
public static final java.lang.String F_NAME_DSR_USER
F_NAME_DSR_TRANSACTION
public static final java.lang.String F_NAME_DSR_TRANSACTION
F_NAME_THREAD_NAME
public static final java.lang.String F_NAME_THREAD_NAME
F_NAME_SEVERITY
public static final java.lang.String F_NAME_SEVERITY
F_NAME_MSG_CLEAR
public static final java.lang.String F_NAME_MSG_CLEAR
ListFormatter
public ListFormatter()
getFields
public static java.util.Map getFields()
compareField
public static boolean compareField(int fieldIndex,
int operater,
java.lang.String valueA,
java.lang.String valueB)
format
public java.lang.String format(LogRecord rec)
- Description copied from class:
Formatter
- Formats a log record which is then ready to be written to a log.
- Overrides:
format in class Formatter
- Following copied from class:
com.sap.tc.logging.Formatter
- Parameters:
rec - Log record to be formatted- Returns:
- Formatted log record
parseMsg
public LogRecord parseMsg(java.lang.String completeMsgData)
throws java.text.ParseException
- Parse message formatted by ListFormatter, current version 1.5.
Also backward compatible with ListFormatter version 1.3 & 1.4
Also work with version 1.2, but may fail for message that spans multiple lines
Can handle string with ending EOL or without ending EOL.
- Overrides:
parseMsg in class Formatter
- Following copied from class:
com.sap.tc.logging.Formatter
- Parameters:
A - complete message body and its admin data that can span across
multiple lines- Returns:
- The complete message with its admin data has been broken down and
packed in
LogRecord. Return Null if formatter does not support
parsing.
parseMsg
public LogRecord parseMsg(byte[] msgChunk)
throws java.text.ParseException
- Overrides:
parseMsg in class Formatter
isCompleteMessage
public boolean isCompleteMessage(java.lang.String msg)
- Determine if the message string reaches the valid end(delimiter) of a
complete message record, according to the format defined by the formatter.
Can handle string with ending EOL or without ending EOL.
Prerequisite (special for ListFormatter, version 1.5 & below):
parameter 'msg' is a message as complete as possible, passing the tail of
the message may fail (unlike XML format, passing the final line of the
closing tag is sufficient enough to check for the end of the message).
- Overrides:
isCompleteMessage in class Formatter
isStartMsg
public boolean isStartMsg(int messageSize,
byte[] message)
- Overrides:
isStartMsg in class Formatter
isCompleteMessage
public boolean isCompleteMessage(int messageSize,
byte[] message,
int delimiterSize,
int[] delimiter)
- Overrides:
isCompleteMessage in class Formatter
isParsable
public boolean isParsable()
- Description copied from class:
Formatter
- Return true if this formatter supports message parsing formatted with this
formatter. Otherwise, return false.
See method
Formatter.parseMsg(String).
- Overrides:
isParsable in class Formatter
isStartMessage
public boolean isStartMessage(java.lang.String msg)
- Determine if the message string has a valid start of message record
Prerequisite: parameter 'msg' is supposed to be a string of at least 1
complete line from logfile
- Overrides:
isStartMessage in class Formatter