|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.sap.tc.logging.Formatter
Formats log records on behalf of logs the formatter is registered with.
Log,
LogController| Method Summary | |
boolean |
equals(java.lang.Object obj)
Compare to Formatter clasess. |
abstract java.lang.String |
format(LogRecord rec)
Formats a log record which is then ready to be written to a log. |
java.lang.String |
getFooter(Log log)
Returns the footer for a set of formatted records. |
java.lang.String |
getFormatterName()
Gets the descriptive name for this formatter. |
FormatterType |
getFormatterType()
Returns the type of formatter instance. If formatter is the predefined classes provided by logging, an explicit formatter type will be returned. |
java.lang.String |
getHeader(Log log)
Returns the header for a set of formatted records. |
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 |
boolean |
isStartMsg(int messageSize,
byte[] message)
|
LogRecord |
parseMsg(byte[] msgChunk)
|
LogRecord |
parseMsg(java.lang.String completeMsgData)
Message written with the specific formatter is read as plain string. |
void |
setFormatterName(java.lang.String name)
Sets a descriptive name for this formatter. |
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public abstract java.lang.String format(LogRecord rec)
rec - Log record to be formattedpublic java.lang.String getHeader(Log log)
log - Target log.public java.lang.String getFooter(Log log)
log - Target logpublic final FormatterType getFormatterType()
FormatterType for the predefined formatter types used in Logging. public java.lang.String getFormatterName()
public void setFormatterName(java.lang.String name)
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic boolean isParsable()
parseMsg(String).
public LogRecord parseMsg(java.lang.String completeMsgData)
throws java.text.ParseException
Message written with the specific formatter is read as plain string. This method parses the content and massages the data into appropriate fields, into a LogRecord structure.
NOTE: UPDATE this method when newer version of format is defined by the formatter.
A - complete message body and its admin data that can span across
multiple linesLogRecord. Return Null if formatter does not support
parsing.
public LogRecord parseMsg(byte[] msgChunk)
throws java.text.ParseException
public boolean isCompleteMessage(java.lang.String msg)
public boolean isStartMessage(java.lang.String msg)
public boolean isStartMsg(int messageSize,
byte[] message)
public boolean isCompleteMessage(int messageSize,
byte[] message,
int delimiterSize,
int[] delimiter)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||