Purpose
Define Error Handler is the service function that identifies the function to be called if an error occurs in the Logger API. The return value is a pointer to the function previously called when an error occurred.
Structure
#include <pxoper.h> PXSTC_Code PX_SetLogError(PX_LogHandle loghandle, PX_ErrorProc errorproc);
where the following is true:
Parameter | Function | Specification |
---|---|---|
loghandle | input | The handle to the log stream. The structure is allocated by the Logger API. |
errorproc | input | The function to be called when an error occurs. |
Return Codes
The Define Error Handler function returns the address of the function previously defined.
Status Code | Signifies |
---|---|
void* | The address of the error procedure previously used. |
Usage Notes
Consider the following when using the Define Error Handler function.
Topic | Usage Notes |
---|---|
See Also | Initiate Log Stream |
Example - Define Error Handler
#include <pxoper.h> PX_ErrorProc myerror1, myerror2; PX_LogHandle loghandle; PX_LogInit(oprhandle, "mycomponent", 75, NULL, myerror1, &loghandle); PX_SetLogError(loghandle, myerror2); PX_Terminate(loghandle);