GetTraceEnableLevel function

The GetTraceEnableLevel function retrieves the severity level passed by the controller to indicate the level of logging the provider should perform.

Providers can only call this function from their ControlCallback function.

Syntax


UCHAR GetTraceEnableLevel(
  _In_  TRACEHANDLE SessionHandle
);

Parameters

SessionHandle [in]

Handle to an event tracing session, obtained by calling the GetTraceLoggerHandle function.

Return value

Returns the value the controller specified in the EnableLevel parameter when calling the EnableTrace function.

To determine if the function failed or the controller set the enable flags to 0, follow these steps:

  • Call the SetLastError function to set the last error to ERROR_SUCCESS.
  • Call the GetTraceEnableLevel function to retrieve the enable level.
  • If the enable level value is 0, call the GetLastError function to retrieve the last known error.
  • If the last known error is ERROR_SUCCESS, the controller set the enable level to 0; otherwise, the GetTraceEnableLevel function failed with the last known error.

Remarks

Providers use this value to control the severity of events that it generates. For example, providers can use this value to determine if it should generate informational, warning, or error events.

Windows Phone 8.1: This API is supported.

Examples

For an example that uses GetTraceEnableLevel, see Retrieving Event Data Using MOF.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Evntrace.h

Library

Advapi32.lib

DLL

Advapi32.dll

See also

GetTraceEnableFlags
GetTraceLoggerHandle

 

 

Community Additions

ADD
Show:
© 2015 Microsoft