Public Member Functions | |
LogConverter () | |
LogConverter (String cols) | |
LogConverter (Collection< LogField > fields, boolean additionlData) | |
void | setCols (String columns) |
void | setCols (Collection< LogField > columns, boolean additionlData) |
abstract String | convert (ILogEntry log) |
abstract String | getHeader () |
Public Attributes | |
final char | ADDITIONAL_DATA_ID = 'j' |
Protected Attributes | |
String | colIndex |
The base class of the converters of the logs.
It is possible:
Note that the format of the XML is not customizable i.e. the selected columns and their order will be ignored while converting.
alma.acs.logging.tools.LogConverter.LogConverter | ( | ) |
Default constructor: the converted string will contain all the fields.
References alma.acs.logging.tools.LogConverter.setCols().
alma.acs.logging.tools.LogConverter.LogConverter | ( | String | cols | ) |
Constructor
cols | A string describing the columns and their position in the converted String |
References alma.acs.logging.tools.LogConverter.setCols().
alma.acs.logging.tools.LogConverter.LogConverter | ( | Collection< LogField > | fields, | |
boolean | additionlData | |||
) |
Constructor
This constructor only allows to have additional data appened at the end of the other fields.
fields | A collection describing the columns and their position in the converted String | |
additionlData | true if the additional data must be appended in the last position of the converted string |
References alma.acs.logging.tools.LogConverter.setCols().
abstract String alma.acs.logging.tools.LogConverter.convert | ( | ILogEntry | log | ) | [pure virtual] |
Convert the log to a string of the given format
log | The log to convert to a String |
Implemented in alma.acs.logging.tools.CSVConverter, alma.acs.logging.tools.TwikiTableConverter, and alma.acs.logging.tools.XMLConverter.
Referenced by alma.acs.logging.tools.LogFileSplitter.logEntryReceived(), and alma.acs.logging.tools.LogFileExtractor.logEntryReceived().
abstract String alma.acs.logging.tools.LogConverter.getHeader | ( | ) | [pure virtual] |
Generate the header for the given converter.
If no header is needed, the heder return an empty string.
Implemented in alma.acs.logging.tools.CSVConverter, alma.acs.logging.tools.TwikiTableConverter, and alma.acs.logging.tools.XMLConverter.
void alma.acs.logging.tools.LogConverter.setCols | ( | String | columns | ) |
Set the columns to write in the converted string.
columns | A string of columns; if null or empty then colIndexs contain all the fields plus the additional data |
References alma.acs.logging.tools.LogConverter.ADDITIONAL_DATA_ID, and alma.acs.logging.tools.LogConverter.colIndex.
Referenced by alma.acs.logging.tools.LogConverter.LogConverter(), and alma.acs.logging.tools.LogConverter.setCols().
void alma.acs.logging.tools.LogConverter.setCols | ( | Collection< LogField > | columns, | |
boolean | additionlData | |||
) |
Set the columns to write in the converted string
columns | A vector of LogField representing the field to write in the converted string | |
additionlData | true if the additional data must be appended in the last position of the converted string |
References alma.acs.logging.tools.LogConverter.ADDITIONAL_DATA_ID, and alma.acs.logging.tools.LogConverter.setCols().
final char alma.acs.logging.tools.LogConverter.ADDITIONAL_DATA_ID = 'j' |
Additional data is not a field of the log so its value is specified here as a constant char
Referenced by alma.acs.logging.tools.LogConverter.setCols().
String alma.acs.logging.tools.LogConverter.colIndex [protected] |
The string representing the columns and their order.
colIndex is composed of chars identifying the column and their position. Each char is is a LogField.id or ADDITIONAL_DATA_ID.
For example if colIndex=="0f1j"
then the converted string contains entries with like that: timestamp, message, log type, addData 1, addData2...addDataN because LogField.TIMESTAMP.id=0, LogFiled.LOGMESSAGE=f, LogField.ENTRYTYPE.id=1 and ADDITIONAL_DATA_ID=j.
Note that this is ignored while converting to XML!
Referenced by alma.acs.logging.tools.CSVConverter.convert(), alma.acs.logging.tools.CSVConverter.getHeader(), and alma.acs.logging.tools.LogConverter.setCols().