-api-id | -api-type |
---|---|
M:Windows.Foundation.Diagnostics.LoggingActivity.#ctor(System.String,Windows.Foundation.Diagnostics.ILoggingChannel) |
winrt method |
Initializes a new instance of the LoggingActivity class for the specified LoggingChannel in Windows 8.1 compatibility mode.
The name of the logging activity.
The logging channel.
Windows 10 Two modes of operation are now supported: Windows 8.1 compatibility mode and the new behavior supported by Windows 10 and later.+ For Windows 8.1 compatibility mode, create the object using a constructor.
- For Windows 10 and later specific behavior, create a LoggingActivity object by using LoggingChannel.StartActivity or LoggingActivity.StartActivity.
The differences between these two modes are:
Windows 8.1 compatibility mode | Windows 10 and later specific behavior |
---|---|
The start event generated by the constructor is formatted for compatibility with the manifest used by LoggingChannel. The start event name is hard-coded as "LogActivityStart" + Level . The event will be a manifest-based event or a self-describing event depending on the operating mode of the underlying channel. |
The start event generated by the StartActivity method follows the conventions of LoggingChannel.LogEvent and will always use a self-describing, i.e. not manifest-based, event encoding. The event name is based on the startEventName parameter. |
The stop event generated by Close() or Dispose() is formatted for compatibility with the manifest used by LoggingChannel. The stop event name is hard-coded as "LogActivityStop" + Level . The event will be a manifest-based event or a self-describing event, depending on the operating mode of the underlying channel. |
The Stop event generated by Close() or Dispose() will follow the conventions of LoggingChannel.LogEvent and will use the self-describing event encoding. The activity name will be used as the stop event name. |
The destructor/finalizer will invoke Close(). | The destructor/finalizer will not invoke Close(). |
LoggingActivity(String, ILoggingChannel, LoggingLevel), LoggingChannel, StartActivity