Protocol Implementation > Define Error and Warning Messages |
To add text messages for use in code:
Edit ReplayApi/Resource Files/<protocol ID>.eng. Add a key and a message text for each message.
The message text can include parameters. For example:
Session opening failed. Last error %_1_ld. Failed to execute HTTP GET request. Last error "%1". Header "%1: %2" added.
Parameter formats
Format | Type of Parameter |
---|---|
%n, %_n_s | string |
%_n_ld | long integer |
%_n_[.precision]f | double. The optional precision is the number of digits to the right of the decimal point. |
%_n_c | char |
You can then output messages by calling methods of The CProtocolExtension Class. For example: CProtocolExtension::Instance()->LogNotifyMessage(STANDARD_LOG_LEVEL, MyProtocolID_DEMO_TEXT_RESOURCE, "param 1");