Safir SDK Core
|
Provides methods for sending sofware reports. More...
Functions | |
SWRE_INTERFACE_CPP_API void | SendFatalErrorReport (const std::wstring &errorCode, const std::wstring &location, const std::wstring &text) |
Sends a Fatal Error report. More... | |
SWRE_INTERFACE_CPP_API void | SendErrorReport (const std::wstring &errorCode, const std::wstring &location, const std::wstring &text) |
Sends an Error report. More... | |
SWRE_INTERFACE_CPP_API void | SendResourceReport (const std::wstring &resourceId, bool allocated, const std::wstring &text) |
Sends a Resource report. More... | |
SWRE_INTERFACE_CPP_API void | SendProgrammingErrorReport (const std::wstring &errorCode, const std::wstring &location, const std::wstring &text) |
Sends a Programming Error report. More... | |
SWRE_INTERFACE_CPP_API void | SendProgramInfoReport (const std::wstring &text) |
Sends a Programming Info report. More... | |
Provides methods for sending sofware reports.
There are five predefined report types:
- Fatal Error Report - Error Report - Resource Report - Program Info report - Programming Error Report
See the corresponding method for a description of the intended usage.
Some methods have both an error code and a text parameter (both of type string). The intended usage is that the error code parameter should be a short mnemonic string and the text parameter should be a more elaborated description. The mnemonic strings are preferably defined as Dob parameters.
From the location parameter string it should be easy to identify the exact code location where the report is generated.
All methods are thread safe.
SWRE_INTERFACE_CPP_API void Safir::SwReports::SendErrorReport | ( | const std::wstring & | errorCode, |
const std::wstring & | location, | ||
const std::wstring & | text | ||
) |
Sends an Error report.
Use it to report detected runtime errors, for example a message from an external system in an invalid format. Normally the program continues to execute, possibly in a degraded state.
[in] | errorCode | Application defined error code (mnemonic). |
[in] | location | Source code location. |
[in] | text | Application defined text. |
SWRE_INTERFACE_CPP_API void Safir::SwReports::SendFatalErrorReport | ( | const std::wstring & | errorCode, |
const std::wstring & | location, | ||
const std::wstring & | text | ||
) |
Sends a Fatal Error report.
Use it to report static conditions that must be fulfilled to be able to start/continue executing the program, for example missing static resources or invalid configuration. Normally the program should not continue to execute.
[in] | errorCode | Application defined error code (mnemonic). |
[in] | location | Source code location. |
[in] | text | Application defined text. |
SWRE_INTERFACE_CPP_API void Safir::SwReports::SendProgramInfoReport | ( | const std::wstring & | text | ) |
Sends a Programming Info report.
Use it to report internal program information for debugging purposes. Normally the sending of this report type is controlled by internal status variables that are set by sending backdoor commands to the program.
[in] | text | Application defined text. |
SWRE_INTERFACE_CPP_API void Safir::SwReports::SendProgrammingErrorReport | ( | const std::wstring & | errorCode, |
const std::wstring & | location, | ||
const std::wstring & | text | ||
) |
Sends a Programming Error report.
Use it to report programming errors, that is, errors of assert-type. Normally the program should not continue to execute, in that way enabling a redundant program instance to start.
[in] | errorCode | Application defined error code (mnemonic). |
[in] | location | Source code location. |
[in] | text | Application defined text. |
SWRE_INTERFACE_CPP_API void Safir::SwReports::SendResourceReport | ( | const std::wstring & | resourceId, |
bool | allocated, | ||
const std::wstring & | text | ||
) |
Sends a Resource report.
Use it to report a missing/acquired dynamic resource. Note that it is ok for dynamic resource to be temporary missing which means that a Resource Report should be sent only after a reasonably number of retries to acquire it.
[in] | resourceId | Application defined resource id (mnemonic). |
[in] | allocated | True if the resource is allocated, otherwise false. |
[in] | text | Application defined text. |