ErrorLib 1.0.8-master SHA: 810228da25
Printing of a logmessage

Logmessages can be printed from everywhere in the code only the header must be included:

#include "lib/Error/LogMessage.h"

A simple logmessage ca be printed by one of the functions:

MSG("This is a sample Logmessage");
LogMessage("This is the same sample Logmessage", LOGMESSAGE_OPTION_NONE);
#define MSG(message)
Print a simple message without any options.
Definition: LogMessage.h:60
#define LogMessage(message, Options)
Print a message with defined options.
Definition: LogMessage.h:71
#define LOGMESSAGE_OPTION_NONE
No option is added to the logmessage.
Definition: LogMessage.h:28

the function MSG is for compatibility reasons with old versions of the message system. Both function calls do the same.

Some messages are for debug purposes only and should not displayed to anybody. These messages are hidden by default and can be shown only to the user-group developer by activating a special menu item.

LogMessage("Sample Logmessage with option debug", LOGMESSAGE_OPTION_DEBUG);
#define LOGMESSAGE_OPTION_DEBUG
This message is only for debug purposes. The user can fadeout this messages if not required.
Definition: LogMessage.h:36

Logmessages with appended data

One to four data words can be attached to a logmessage. The data is embedded in the logmessage-text with a printf-like syntax. Example of an unsigned integer in a debug-message:

LogMessageData1("Create new Logfile Nr. %u", g_ui32LogFileNumber, LOGMESSAGE_OPTION_DEBUG);
#define LogMessageData1(message, dat1, Options)
Print a message with defined options and one data-field.
Definition: LogMessage.h:119

All 32-Bit variables can be attached.

Repeated logmessages

If a logmessage is repeated with no other messages in between, the Message is only stored once. The number of repetitions is stored after another message is sent.

Alert-Messages

Some messages requires immediate alert to the user, for example if the requested action is failed. These messages are reportet in the error log as ordinary messages, but an additional message box is shown on the connected PC. This messagebox is shown only if the connection to the pc is already established when the alertmessage is fired.

LogMessageAlert("This is an alert message");
LogMessage("This is an alert message", LOGMESSAGE_OPTION_ALERT); //This is equal to the line before
#define LOGMESSAGE_OPTION_ALERT
This message results into an alert message-box on PC.
Definition: LogMessage.h:34
#define LogMessageAlert(message)
Print a message and show this message immediately in a messagebox on all connected PCs.
Definition: LogMessage.h:81