TraceLoggingThreadActivity class (traceloggingactivity.h)
Provides support for logging ETW events during an activity. Events will be automatically tagged with or nested in this activity.
The TraceLoggingThreadActivity class implements _TlgActivityBase.
The TraceLoggingThreadActivity class has these methods.
TraceLoggingThreadActivity::Provider (traceloggingactivity.h) returns the handle to the TraceLogging provider associated with this activity.
Initializes a new instance of the TraceLoggingThreadActivity class. (overload 2/2)
Initializes a new instance of the TraceLoggingThreadActivity class. (overload 1/2)
This class works by setting a per-thread variable. Only events occurring on the active thread will be automatically tagged.
In order to use TraceLogging activities, you need to define an instance of either TraceLoggingActivity or TraceLoggingThreadActivity. After you have created an instance of one of these classes, you manipulate activity logging using After you have created an instance of one of these classes, you manipulate activity logging using TraceLoggingFunction, TraceLoggingWriteStart, TraceLoggingWriteStop, and TraceLoggingWriteTagged. This class automatically creates a unique identifier when tracing is turned on and the activity is started.
Any active threads will be automatically nested in this instance when you start logging with a TraceLoggingThreadActivity object. In addition, all events will be automatically logged with this object's unique identifier.
Only use this class when you can guarantee that all activities for this thread are fully nested. You must ensure that no child activity will outlast a parent activity, even in error cases or edge cases.
In DEBUG builds, the class will raise an assertion during its Stop event, if it detects incorrect activity nesting, or if the Stop event occurs on a thread other than the thread used to start it.
This class is not available for store applications.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2012 R2 [desktop apps only]|