Safir SDK Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Safir::SwReports Namespace Reference

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...
 

Detailed Description

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.

Deprecated:
use Safir::Logging::SendSystemLog() instead.

Function Documentation

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.

Parameters
[in]errorCodeApplication defined error code (mnemonic).
[in]locationSource code location.
[in]textApplication defined text.
Deprecated:
use Safir::Logging::SendSystemLog() instead.
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.

Parameters
[in]errorCodeApplication defined error code (mnemonic).
[in]locationSource code location.
[in]textApplication defined text.
Deprecated:
use Safir::Logging::SendSystemLog() instead.
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.

Parameters
[in]textApplication defined text.
Deprecated:
use Safir::Logging::SendSystemLog() instead.
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.

Parameters
[in]errorCodeApplication defined error code (mnemonic).
[in]locationSource code location.
[in]textApplication defined text.
Deprecated:
use Safir::Logging::SendSystemLog() instead.
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.

Parameters
[in]resourceIdApplication defined resource id (mnemonic).
[in]allocatedTrue if the resource is allocated, otherwise false.
[in]textApplication defined text.
Deprecated:
use Safir::Logging::SendSystemLog() instead.