|
MLPIRESULT | mlpiTraceMessage (const MLPIHANDLE connection, const WCHAR16 *text, const WCHAR16 *moduleName=0, const WCHAR16 *functionName=0, const LONG lineNumber=0) |
|
MLPIRESULT | mlpiTraceWarning (const MLPIHANDLE connection, const WCHAR16 *text, const WCHAR16 *moduleName=0, const WCHAR16 *functionName=0, const LONG lineNumber=0) |
|
MLPIRESULT | mlpiTraceError (const MLPIHANDLE connection, const WCHAR16 *text, const WCHAR16 *moduleName=0, const WCHAR16 *functionName=0, const LONG lineNumber=0) |
|
MLPIRESULT | mlpiTraceEvent (const MLPIHANDLE connection, const WCHAR16 *text, const WCHAR16 *moduleName=0, const WCHAR16 *functionName=0, const LONG lineNumber=0) |
|
Use the following functions to add new entries to the trace system.
This function traces a message.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | text | Message text. |
[in] | moduleName | Module filter name. |
[in] | functionName | Name of source function. |
[in] | lineNumber | Line of source file. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Note
- The message gets discarded if the corresponding module is not activated. Use mlpiTraceActivateModule to activate the module.
- Example:
1 // let's define some macros for automatic function and line insertion
2 #define TRACE_MESSAGE(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceMessage(c, t, m, f, __LINE__); }
3 #define TRACE_WARNING(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceWarning(c, t, m, f, __LINE__); }
4 #define TRACE_ERROR(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceError(c, t, m, f, __LINE__); }
5 #define TRACE_EVENT(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceEvent(c, t, m, f, __LINE__); }
7 // Use macro to set a trace message
8 TRACE_MESSAGE(connection, L"MLPI_TRACE_USER", L"This is a test message for the trace.");
This function traces a warning.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | text | Message text. |
[in] | moduleName | Module filter name. |
[in] | functionName | Name of source function. |
[in] | lineNumber | Line of source file. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Note
- The message gets discarded if the corresponding module is not activated. Use mlpiTraceActivateModule to activate the module.
- Example:
1 // let's define some macros for automatic function and line insertion
2 #define TRACE_MESSAGE(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceMessage(c, t, m, f, __LINE__); }
3 #define TRACE_WARNING(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceWarning(c, t, m, f, __LINE__); }
4 #define TRACE_ERROR(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceError(c, t, m, f, __LINE__); }
5 #define TRACE_EVENT(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceEvent(c, t, m, f, __LINE__); }
7 // Use macro to set a trace warning
8 TRACE_WARNING(connection, L"MLPI_TRACE_USER", L"This is a test warning for the trace.");
This function traces an error.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | text | Message text. |
[in] | moduleName | Module filter name. |
[in] | functionName | Name of source function. |
[in] | lineNumber | Line of source file. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Note
- The error gets discarded if the corresponding module is not activated. Use mlpiTraceActivateModule to activate the module.
- Example:
1 // let's define some macros for automatic function and line insertion
2 #define TRACE_MESSAGE(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceMessage(c, t, m, f, __LINE__); }
3 #define TRACE_WARNING(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceWarning(c, t, m, f, __LINE__); }
4 #define TRACE_ERROR(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceError(c, t, m, f, __LINE__); }
5 #define TRACE_EVENT(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceEvent(c, t, m, f, __LINE__); }
7 // Use macro to set a trace error
8 TRACE_ERROR(connection, L"MLPI_TRACE_USER", L"This is a test error for the trace.");
This function traces an event.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | text | Message text. |
[in] | moduleName | Module filter name. |
[in] | functionName | Name of source function. |
[in] | lineNumber | Line of source file. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Note
- The event gets discarded if the corresponding module is not activated. Use mlpiTraceActivateModule to activate the module.
- Example:
1 // let's define some macros for automatic function and line insertion
2 #define TRACE_MESSAGE(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceMessage(c, t, m, f, __LINE__); }
3 #define TRACE_WARNING(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceWarning(c, t, m, f, __LINE__); }
4 #define TRACE_ERROR(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceError(c, t, m, f, __LINE__); }
5 #define TRACE_EVENT(c, m, t) { WCHAR16* f = A2W16(__FUNCTION__); mlpiTraceEvent(c, t, m, f, __LINE__); }
7 // Use macro to set a trace event
8 TRACE_EVENT(connection, L"MLPI_TRACE_USER", L"This is a test event for the trace.");