PostSharp 6.4 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Custom Namespace / Log­Level­Source Class / Log­Level­Source Methods / Log­Level­Source.​Log­Activity Method / Log­Level­Source.​Log­Activity(TDescription) Method (TDescription, Action, Open­Activity­Options)

LogLevelSource.LogActivity<TDescription> Method (TDescription, Action, OpenActivityOptions)

Executes an Action and logs its execution.

Namespace:  PostSharp.Patterns.Diagnostics.Custom
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.4.11.0 (6.4.11.0)
Syntax
C#
public void LogActivity<TDescription>(
	 in TDescription description,
	Action 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.Action
The action be be executed.
options (Optional)
Type: PostSharp.Patterns.Diagnostics.OpenActivityOptions
Options.

Type Parameters

TDescription
The type of the description message.
See Also