PostSharpAPI ReferencePost­Sharp.​Patterns.​DiagnosticsLog­Activity
Open sandboxFocus

Class LogActivity

Represents a logged custom activity, i.e. something that a beginning and an end with a specific outcome. This class is instantiated by the legacy API of the Logger class. For the modern API, see LogActivity<TActivityDescription>.

Inheritance
LogActivity
Implements
IDisposable
Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Common.dll
Syntax
[RequirePostSharp("PostSharp.Patterns.Common.Weaver", "AddCallerInfoTask", AnyTypeReference = true)]
public class LogActivity : Logger

Constructors

Name Description
LogActivity(ILogger, ILoggingContext)

Initializes a new LogActivity.

Properties

Name Description
Context

Gets the ILoggingContext created from the current LogActivity.

IsValid

Determines whether the current LogActivity is valid, i.e. calls to methods SetFailure() or SetException(Exception) will do something, or will be totally ignored.

Methods

Name Description
Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Dispose(Boolean)

Disposes the current LogActivity.

Resume()

Resumes the current async activity after it has been suspended by a call to Suspend(). There is typically no need to invoke this method in user code because all async methods that use the Logger class are automatically instrumented.

Resume(ref CallerInfo)
SetException(Exception)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with a given Exception.

SetException(Exception, ref CallerInfo)
SetFailure()

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with failure with the default failure message.

SetFailure(ref CallerInfo)
SetFailure(String)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with failure and specifies a parameterless failure message.

SetFailure(String, ref CallerInfo)
SetFailure(String, Object[])

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with failure and specifies a failure message with an array of parameters.

SetFailure(String, Object[], ref CallerInfo)
SetFailure<T1>(String, T1)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with failure and specifies a failure message with 1 parameter.

SetFailure<T1>(String, T1, ref CallerInfo)
SetFailure<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(String, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with failure and specifies a failure message with 10 parameters.

SetFailure<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(String, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, ref CallerInfo)
SetFailure<T1, T2>(String, T1, T2)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with failure and specifies a failure message with 2 parameters.

SetFailure<T1, T2>(String, T1, T2, ref CallerInfo)
SetFailure<T1, T2, T3>(String, T1, T2, T3)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with failure and specifies a failure message with 3 parameters.

SetFailure<T1, T2, T3>(String, T1, T2, T3, ref CallerInfo)
SetFailure<T1, T2, T3, T4>(String, T1, T2, T3, T4)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with failure and specifies a failure message with 4 parameters.

SetFailure<T1, T2, T3, T4>(String, T1, T2, T3, T4, ref CallerInfo)
SetFailure<T1, T2, T3, T4, T5>(String, T1, T2, T3, T4, T5)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with failure and specifies a failure message with 5 parameters.

SetFailure<T1, T2, T3, T4, T5>(String, T1, T2, T3, T4, T5, ref CallerInfo)
SetFailure<T1, T2, T3, T4, T5, T6>(String, T1, T2, T3, T4, T5, T6)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with failure and specifies a failure message with 6 parameters.

SetFailure<T1, T2, T3, T4, T5, T6>(String, T1, T2, T3, T4, T5, T6, ref CallerInfo)
SetFailure<T1, T2, T3, T4, T5, T6, T7>(String, T1, T2, T3, T4, T5, T6, T7)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with failure and specifies a failure message with 7 parameters.

SetFailure<T1, T2, T3, T4, T5, T6, T7>(String, T1, T2, T3, T4, T5, T6, T7, ref CallerInfo)
SetFailure<T1, T2, T3, T4, T5, T6, T7, T8>(String, T1, T2, T3, T4, T5, T6, T7, T8)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with failure and specifies a failure message with 8 parameters.

SetFailure<T1, T2, T3, T4, T5, T6, T7, T8>(String, T1, T2, T3, T4, T5, T6, T7, T8, ref CallerInfo)
SetFailure<T1, T2, T3, T4, T5, T6, T7, T8, T9>(String, T1, T2, T3, T4, T5, T6, T7, T8, T9)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with failure and specifies a failure message with 9 parameters.

SetFailure<T1, T2, T3, T4, T5, T6, T7, T8, T9>(String, T1, T2, T3, T4, T5, T6, T7, T8, T9, ref CallerInfo)
SetSuccess()

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with success with the default success message.

SetSuccess(ref CallerInfo)
SetSuccess(String)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with success and specifies a parameterless success message.

SetSuccess(String, ref CallerInfo)
SetSuccess(String, Object[])

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with success and specifies a success message with an array of parameters.

SetSuccess(String, Object[], ref CallerInfo)
SetSuccess<T1>(String, T1)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with success and specifies a success message with 1 parameter.

SetSuccess<T1>(String, T1, ref CallerInfo)
SetSuccess<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(String, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with success and specifies a success message with 10 parameters.

SetSuccess<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(String, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, ref CallerInfo)
SetSuccess<T1, T2>(String, T1, T2)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with success and specifies a success message with 2 parameters.

SetSuccess<T1, T2>(String, T1, T2, ref CallerInfo)
SetSuccess<T1, T2, T3>(String, T1, T2, T3)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with success and specifies a success message with 3 parameters.

SetSuccess<T1, T2, T3>(String, T1, T2, T3, ref CallerInfo)
SetSuccess<T1, T2, T3, T4>(String, T1, T2, T3, T4)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with success and specifies a success message with 4 parameters.

SetSuccess<T1, T2, T3, T4>(String, T1, T2, T3, T4, ref CallerInfo)
SetSuccess<T1, T2, T3, T4, T5>(String, T1, T2, T3, T4, T5)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with success and specifies a success message with 5 parameters.

SetSuccess<T1, T2, T3, T4, T5>(String, T1, T2, T3, T4, T5, ref CallerInfo)
SetSuccess<T1, T2, T3, T4, T5, T6>(String, T1, T2, T3, T4, T5, T6)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with success and specifies a success message with 6 parameters.

SetSuccess<T1, T2, T3, T4, T5, T6>(String, T1, T2, T3, T4, T5, T6, ref CallerInfo)
SetSuccess<T1, T2, T3, T4, T5, T6, T7>(String, T1, T2, T3, T4, T5, T6, T7)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with success and specifies a success message with 7 parameters.

SetSuccess<T1, T2, T3, T4, T5, T6, T7>(String, T1, T2, T3, T4, T5, T6, T7, ref CallerInfo)
SetSuccess<T1, T2, T3, T4, T5, T6, T7, T8>(String, T1, T2, T3, T4, T5, T6, T7, T8)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with success and specifies a success message with 8 parameters.

SetSuccess<T1, T2, T3, T4, T5, T6, T7, T8>(String, T1, T2, T3, T4, T5, T6, T7, T8, ref CallerInfo)
SetSuccess<T1, T2, T3, T4, T5, T6, T7, T8, T9>(String, T1, T2, T3, T4, T5, T6, T7, T8, T9)

Ends an activity (opened with OpenActivity(String) or OpenAsyncActivity(String) with success and specifies a success message with 9 parameters.

SetSuccess<T1, T2, T3, T4, T5, T6, T7, T8, T9>(String, T1, T2, T3, T4, T5, T6, T7, T8, T9, ref CallerInfo)
Suspend()

Suspends the current async activity. The activity must than be resumed by a call of the Resume() method. There is typically no need to invoke this method in user code because all async methods that use the Logger class are automatically instrumented.

Suspend(ref CallerInfo)