PostSharp 5.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics Namespace / Logger Class / Logger Methods / Logger.​Open­Activity Method / Logger.​Open­Activity Method (Log­Activity­Options, String)

Logger.OpenActivity Method (LogActivityOptions, String)

Opens a custom activity with an optional description, but without parameters. The activity must be synchronous, i.e. must fully execute on the same thread and must not be interrupted by an await or yield return operator.

Namespace:  PostSharp.Patterns.Diagnostics
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 5.0.55.0 (5.0.55.0)
Syntax
C#
public LogActivity OpenActivity(
	LogActivityOptions options,
	string text = null
)

Parameters

options
Type: PostSharp.Patterns.Diagnostics.LogActivityOptions
text (Optional)
Type: System.String
A description of the activity, or null to use the caller method name as the activity description.

Return Value

Type: LogActivity
A Logger representing the new activity.
Remarks
The activity must be closed using [!:SetSuccess(string)], [!:SetFailure(String)] or [!:SetException(Exception)].
See Also