Define message identifiers
The error log contains error, warning, and informational messages that are relayed to users.
To better classify messages than simply by the categories error, warning, and information, you can define individual identifiers for each message written to the log. You can then catalog and track your messages.
A message identifier has two parts: the module identifier and the message index number. The module identifier defines the functional component that issued the message. The message index is a unique value for each message within each module identifier.
You do not have to construct an APT_ErrorLog object for a derived operator, partitioner, or collector. APT_ErrorLog objects are generated for you, with the module identifier APT_userErrorSourceModule, when an object is instantiated from a derived class. You only need to specify a module identifier if you create your own APT_ErrorLog objects.
The list of available module identifiers is extensible.
The message index number is a unique value for each error, warning, or informational message you write to an error log for a given module identifier. Typically, you define a base value for your message index, then modify this value for every unique message written to the log.
#define MESSAGE_ID_BASE 0
When writing an error message to the error log, you would then specify a message index value as shown:
APT_ErrorLog eLog(APT_userErrorSourceModule);// create an error log
*eLog << "a string"; // write a message to error log
eLog.logError(MESSAGE_ID_BASE + 1); // log the error message and index
Subsequent messages written to the log would have an index
of MESSAGE_ID_BASE + 2, MESSAGE_ID_BASE + 3, and so on, All messages
have a unique index within each module identifier. Creating a unique
index for each of your error messages allows you to catalog and track
your messages.