TraceLoggingKeyword macro (traceloggingprovider.h)

TraceLogging wrapper macro that sets the keyword for the event.

Syntax

void TraceLoggingKeyword(
  [in]  eventKeyword
);

Parameters

[in] eventKeyword

A 64-bit bitmask used to indicate an event's membership in a set of event categories. This value must be a compile-time constant.

Important

ProviderId, Level and Keyword are the primary means for filtering events. Other kinds of filtering are possible but have much higher overhead. Always assign a meaningful non-zero level and keyword to every event.

See EVENT_DESCRIPTOR for details about the event keyword.

Return value

None

Remarks

TraceLoggingKeyword(eventKeyword) can be used as a parameter to an invocation of a TraceLoggingWrite macro to set the event's keyword. Event keyword is a primary means for filtering events. Always assign a meaningful (non-zero) keyword to every event.

If no TraceLoggingKeyword macros are provided to a TraceLoggingWrite call, the event's default keyword is 0. If multiple TraceLoggingKeyword macros are provided, the values are OR'ed together.

The top 16 bits of the keyword (bitmask 0xFFFF000000000000) are defined by Microsoft. The low 48 bits of the keyword (bitmask 0x0000FFFFFFFFFFFF) are defined by the event provider. For example, the event provider might define bit 0 (bitmask 0x1) to be the "I/O" category, bit 1 (bitmask 0x2) to be the "UI" category, and bit 2 (bitmask 0x4) to be the "performance measurement" category. In this scenario, an event might have its keyword set to 0x5, indicating that the event is in both the "I/O" and "performance measurement" categories.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header traceloggingprovider.h

See also

EVENT_DESCRIPTOR

TraceLoggingWrite

TraceLogging wrapper macros