

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 | ( | ) | [inline] |
Default constructor: the converted string will contain all the fields.
References setCols().
| alma::acs::logging::tools::LogConverter::LogConverter | ( | String | cols | ) | [inline] |
Constructor
| cols | A string describing the columns and their position in the converted String |
References setCols().
| alma::acs::logging::tools::LogConverter::LogConverter | ( | Collection< LogField > | fields, | |
| boolean | additionlData | |||
| ) | [inline] |
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 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::table::TablePopupMenu::copyToClipboard(), alma::acs::logging::tools::LogFileSplitter::logEntryReceived(), alma::acs::logging::tools::LogFileExtractor::logEntryReceived(), and alma::acs::logging::table::TablePopupMenu::saveSelectedLogs().
| 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 | ( | Collection< LogField > | columns, | |
| boolean | additionlData | |||
| ) | [inline] |
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 ADDITIONAL_DATA_ID, and setCols().
| void alma::acs::logging::tools::LogConverter::setCols | ( | String | columns | ) | [inline] |
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 ADDITIONAL_DATA_ID, and colIndex.
Referenced by alma::acs::logging::table::TablePopupMenu::copyToClipboard(), LogConverter(), alma::acs::logging::table::TablePopupMenu::saveSelectedLogs(), setCols(), alma::acs::jlog::test::tools::ConvertersTest::testColumnsVector(), and alma::acs::jlog::test::tools::ConvertersTest::testSetWrongColumns().
| 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 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 setCols().
1.6.2