แชร์ผ่าน


ITurnContextExtensions.TraceActivityAsync Method

Definition

Sends a trace activity to the BotAdapter for logging purposes.

public static System.Threading.Tasks.Task<Microsoft.Bot.Schema.ResourceResponse> TraceActivityAsync (this Microsoft.Bot.Builder.ITurnContext turnContext, string name, object value = default, string valueType = default, string label = default, System.Threading.CancellationToken cancellationToken = default);
static member TraceActivityAsync : Microsoft.Bot.Builder.ITurnContext * string * obj * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.ResourceResponse>
<Extension()>
Public Function TraceActivityAsync (turnContext As ITurnContext, name As String, Optional value As Object = Nothing, Optional valueType As String = Nothing, Optional label As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResourceResponse)

Parameters

turnContext
ITurnContext

The context for the current turn.

name
String

The value to assign to the activity's Name property.

value
Object

The value to assign to the activity's Value property.

valueType
String

The value to assign to the activity's ValueType property.

label
String

The value to assign to the activity's Label property.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

A task that represents the work queued to execute.

Remarks

If the adapter is being hosted in the Emulator, the task result contains a ResourceResponse object with the original trace activity's ID; otherwise, it contains a ResourceResponse object containing the ID that the receiving channel assigned to the activity.

Applies to