PostSharp.ILAPI ReferencePost­Sharp.​Patterns.​Diagnostics.​CustomLog­Level­SourceLog­Activity­Async
Open sandboxFocus

LogLevelSource.LogActivityAsync Method

LogActivityAsync<TDescription>(in TDescription, Func<Task>, in OpenActivityOptions)

Executes an asynchronous void delegate and logs its execution.

Declaration
public Task LogActivityAsync<TDescription>(in TDescription description, Func<Task> action, in OpenActivityOptions options = null)
where TDescription : IMessage
Parameters
Type Name Description
TDescription description

The activity description, typically created using the SemanticMessageBuilder or FormattedMessageBuilder class.

System.Func<System.Threading.Tasks.Task> action

The action be be executed.

OpenActivityOptions options

Options.

Returns
Type Description
System.Threading.Tasks.Task

The System.Threading.Tasks.Task.

Type Parameters
Name Description
TDescription

The type of the description message.

LogActivityAsync<TDescription>(in TDescription, Func<Task>, in OpenActivityOptions, ref CallerInfo)

Declaration
public Task LogActivityAsync<TDescription>(in TDescription description, Func<Task> action, in OpenActivityOptions options, ref CallerInfo callerInfo)
where TDescription : IMessage
Parameters
Type Name Description
TDescription description
System.Func<System.Threading.Tasks.Task> action
OpenActivityOptions options
CallerInfo callerInfo
Returns
Type Description
System.Threading.Tasks.Task
Type Parameters
Name Description
TDescription

LogActivityAsync<TDescription, TResult>(in TDescription, Func<Task<TResult>>, in OpenActivityOptions)

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

Declaration
public Task<TResult> LogActivityAsync<TDescription, TResult>(in TDescription description, Func<Task<TResult>> action, in OpenActivityOptions options = null)
where TDescription : IMessage
Parameters
Type Name Description
TDescription description

The activity description, typically created using the SemanticMessageBuilder or FormattedMessageBuilder class.

System.Func<Task<TResult>> action

The action be be executed.

OpenActivityOptions options

Options.

Returns
Type Description
Task<TResult>

A Task<TResult> whose result will be set to the result of action.

Type Parameters
Name Description
TDescription

The type of the description message.

TResult

The type of the return value of the action to execute.

LogActivityAsync<TDescription, TResult>(in TDescription, Func<Task<TResult>>, in OpenActivityOptions, ref CallerInfo)

Declaration
public Task<TResult> LogActivityAsync<TDescription, TResult>(in TDescription description, Func<Task<TResult>> action, in OpenActivityOptions options, ref CallerInfo callerInfo)
where TDescription : IMessage
Parameters
Type Name Description
TDescription description
System.Func<Task<TResult>> action
OpenActivityOptions options
CallerInfo callerInfo
Returns
Type Description
Task<TResult>
Type Parameters
Name Description
TDescription
TResult