MQeTraceCmd

Description
Starts, stops and sets the option of the WebSphere MQ Everyplace runtime tracing facility. The destination of the trace output is platform dependent. On PalmOS, the trace is written to a standard MemoPad database and can be viewed by calling the MemoPad application.

Syntax
#include <hmq.h>
MQEVOID MQeTraceCmd ( MQEHSESS hSess, MQEINT32 Cmd, MQEINT32 Parm, 
                      MQEINT32 * pCompCode, MQEINT32 * pReason); 

Parameters

MQEHSESS hSess - input
This session handle returned by MQeInitialize.

MQEINT32 Cmd - input

MQE_TRACE_CMD_START
Starts the trace. Parm is ignore.

MQE_TRACE_CMD_STOP
Stops the trace. Parm is ignore

MQE_TRACE_CMD_SET_MASK
Set the trace mask bits specified in Parm

MQEINT32 Parm - input
If Cmd is MQE_TRACE_CMD_SET_MASK then this parameter is

MQE_TRACE_OPTION_APP_MSG
Write out an application trace string that starts with a character

MQE_TRACE_OPTION_APP_INFO
Write out an application trace string that starts with character 'I'

MQE_TRACE_OPTION_APP_WARNING
Write out an application trace string that starts with character 'W'

MQE_TRACE_OPTION_APP_ERROR
Write out an application trace string that starts with character 'E'

MQE_TRACE_OPTION_APP_DEBUG
Write out an application trace string that starts with character 'D'

MQE_TRACE_OPTION_APP_ALL
Write out all application trace strings

MQE_TRACE_OPTION_SYS_MSG
Write out a system trace string that starts with character '_'

MQE_TRACE_OPTION_SYS_INFO
Write out a system trace string that starts with character 'i'.

MQE_TRACE_OPTION_SYS_WARNING
Write out a system trace string that starts with character 'w'

MQE_TRACE_OPTION_SYS_ERROR
Write out a system trace string that starts with character 'e'

MQE_TRACE_OPTION_SYS_DEBUG
Write out a system trace string that starts with character 'd'

MQE_TRACE_OPTION_SYS_ALL
Write out all system trace strings.

MQEINT32 * pCompCode - output
MQECC_OK, MQECC_WARNING or MQECC_ERROR.

MQEINT32 * pReason - output
If the returned *pCompCode equals MQECC_ERROR, *pReason may have any of the following values:

MQE_EXCEPT_INVALID_HANDLE

MQE_EXCEPT_ALLOCATION_FAIL
The WebSphere MQ Everyplace library has too few resources.

Return Value
None.

Example
#include <hmq.h>
MQEHSESS hSess;
MQEINT32  compcode, reason;
 
hSess = MQeInitialize("MyAppsName", &compcode, &reason);
 
/* Start the trace */
MQeTraceCmd ( hSess, MQE_TRACE_CMD_START, 0, 
              &compcode, &reason );
MQeTraceCmd ( hSess, MQE_TRACE_CMD_SET_MASK, 
              MQE_TRACE_OPTION_SYS_ERROR | MQE_TRACE_OPTION_APP_MSG,
              &compcode, &reason);
 
MQeTrace( hSess, MQTS(" Starting MQe..."));
MQeTrace( hSess, MQTS("IThis is a information trace msg."));
 
/* Stop the trace */
MQeTraceCmd ( hSess, MQE_TRACE_CMD_STOP, 0, &compcode, &reason );
 
/* Terminate the MQe session */
MQeTerminate( hSess, &compcode, &reason);

See Also
MQeTrace


© IBM Corporation 2002. All Rights Reserved