VLSsetTraceHandler
Syntax
LS_STATUS_CODE VLSsetTraceHandler (
LS_STATUS_CODE (*myTraceHandler)(int traceLevel, char *buffer, int bufferSize));
Argument | Description |
myTraceHandler |
A pointer to the trace handling function. |
Description
Registers a handler to which the trace messages that are generated at run-time are sent.
This API is used to register a handler to which the trace messages that are generated at run-time are sent. The myTraceHandler argument must point to the trace handling function, which must be defined by the caller, and adhere to the prototype given below:
LS_STATUS_CODE myTraceHandler (
int traceLevel,
char *buffer,
int bufferSize );
In the above prototype:
>traceLevel is the current level for tracing. The default value is VLS_NO_TRACE.
>buffer is to store the formatted trace messages. The trace messages passed depend on the the level set.
>bufferSize is to store the size of the buffer argument passed.
>If a handler is already registered and a new handler is passed as myTraceHandler argument, the API un-registers the existing handler and registers the new one. Also, once registered, a handler cannot be unregistered without rebuilding the application.
Returns
The status code LS_SUCCESS is returned if successful. Otherwise, it will return the following error codes:
Error Code |
Description |
VLS_CALLING_ERROR |
The argument specified is not correct, that is, myTraceHandler is NULL. |
VLS_RESOURCE_LOCK_FAILURE |
Failed to obtain the API resource lock. On receiving this error, retry calling this API function. |
For a complete list of the error codes, see Licensing Library Error and Result Codes.