PostSharp 6.5 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Custom Namespace / Log­Level­Source Class / Log­Level­Source Methods / Log­Level­Source.​Log­Activity­Async Method / Log­Level­Source.​Log­Activity­Async(TDescription, TResult) Method (TDescription, Func(Task(TResult)), Open­Activity­Options)

LogLevelSource.LogActivityAsync<TDescription, TResult> Method (TDescription, Func<Task<TResult>>, OpenActivityOptions)

Executes an asynchronous non-void delegate and logs its execution.

Namespace:  PostSharp.Patterns.Diagnostics.Custom
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.5.19.0 (6.5.19.0)
Syntax
C#
public Task<TResult> LogActivityAsync<TDescription, TResult>(
	 in TDescription description,
	Func<Task<TResult>> action,
	 in OpenActivityOptions options = null
)
where TDescription : IMessage

Parameters

description
Type: TDescription
The activity description, typically created using the SemanticMessageBuilder or FormattedMessageBuilder class.
action
Type: System.Func<Task<TResult>>
The action be be executed.
options (Optional)
Type: PostSharp.Patterns.Diagnostics.OpenActivityOptions
Options.

Type Parameters

TDescription
The type of the description message.
TResult
The type of the return value of the action to execute.

Return Value

Type: Task<TResult>
A Task<TResult> whose result will be set to the result of action.
See Also