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

Logger.OpenActivity<T1> Method (String, T1)

Opens a custom activity with a description containing 1 parameter. 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<T1>(
	string text,
	T1 arg1
)

Parameters

text
Type: System.String
The description of the activity, including parameters (e.g. Writing {LineCount} line(s) in file {Path}).
arg1
Type: T1
Value of the first parameter.

Type Parameters

T1
Type of the first parameter.

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