Logger messages can be sent from the program via an already registered logger point. To send a logger message, the method AddLogEntry of the logger point must be called.
The method AddLogEntry requires the following inputs:
oi_sMessage: The logger message as free text. Numbers or enumerations have to be converted to a STRING before they can be sent as a part of the message.
oi_etLogLevel: Every message has to be assigned with an ET_LogLevel according to the importance of the message.
oi_etDiag, i_udiDiagExt: Every message gets the diagnostic data to support better filtering.
Each logger point can be assigned to a logger level that represents the priority of the messages. The logger point sends the message to the application logger. If the logger level that is given to the AddLogEntry method has a lower priority than the logger level of the logger point, then the message is ignored and not added to the logging of the application logger.
Because of this filter mechanism, debug messages can be handled in the same way as high-priority diagnostic messages without producing too many messages.
Nevertheless, the following two rules have to be considered when sending logger messages:
1. Each call of the method AddLogEntry adds a new message to the application logger. If you do not want to create a new logging entry, make sure not to call this method cyclically in your project or many times in a single cycle.
2. The call of the AddLogEntry method does not need much CPU power. However, keep in mind that the creation of the log message with more string operations such as the CONCAT, INSERT, and so on, can take much more CPU power. If several string operations are used to create the message, verify if the message is sent to the application logger. If the logger level of the message has a lower priority than the logger level of the logging point, then there is no need to create the message.