LogLevelSource.LogActivity<TDescription, TResult> Method (TDescription, Func<TResult>, OpenActivityOptions) |
Executes a Func<TResult> and logs its execution.
Namespace: PostSharp.Patterns.Diagnostics.Custom
Assembly: PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.9.11.0 (6.9.11.0)
C#
public TResult LogActivity<TDescription, TResult>( in TDescription description, Func<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<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: TResultThe return value of action.