Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Contexts Namespace / Async­Method­Logging­Context Class

AsyncMethodLoggingContext Class

A LoggingContext that represents an asynchronous method.
Inheritance Hierarchy

Namespace:  PostSharp.Patterns.Diagnostics.Contexts
Assembly:  PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 6.1.6.0 (6.1.6.0)
Syntax
C#
public class AsyncMethodLoggingContext : AsyncLoggingContext

The AsyncMethodLoggingContext type exposes the following members.

Constructors
  NameDescription
Public methodAsyncMethodLoggingContext
Creates an instance of AsyncMethodLoggingContext.
Properties
  NameDescription
Public propertyActivationContext
Gets the LoggingContext in which the current context was activated. If the current context has been resumed, ActivationContext refers to the context in which the context was resumed.
(Inherited from LoggingContext.)
Public propertyAsyncCallId
Gets the unique identifier of the asynchronous call represented by the current AsyncMethodLoggingContext.
Public propertyAwaitedMethod
Gets the awaited method (i.e. the operand of the await operator), or null if it could not be determined or if the IncludeAwaitedTask profile property is set to false.
Public propertyAwaitedTask
Gets the awaited Task (i.e. the operand of the await operator), or null if it could not be determined or if the IncludeAwaitedTask profile property is set to false.
Public propertyBackend
Gets the parent LoggingBackend of the current context.
(Inherited from LoggingContext.)
Public propertyDescription
Gets the description of the current context. The description is typically set by the LogRecordBuilder when building the opening record of a context.
(Inherited from LoggingContext.)
Public propertyId
Gets or set the identifier of the current context. This property should be used for debugging only. Its value is lazily created.
(Inherited from LoggingContext.)
Public propertyIndentLevel
Gets or sets the indentation level for the current context.
(Inherited from LoggingContext.)
Public propertyIsAsync
Determines whether the current LoggingContext represents an async method or an asynchronous custom activity.
(Inherited from LoggingContext.)
Public propertyIsDisposed
Determines whether the current context has been disposed.
(Inherited from LoggingContext.)
Public propertyIsSharable
Determines whether the current LoggingContext can be accessed outside of its nominal lifetype (for instance after the method has completed or a custom activity has beeen closed). Since contexts can be pooled and reused, consumers must call the MakeSharable() method if they want to keep a reference to the LoggingContext and access it after its nominal lifetime has completed.
(Inherited from LoggingContext.)
Public propertyIsSuspended
Determines whether the current context is currently suspended (between a Suspend() and a Resume()).
(Inherited from SuspendableLoggingContext.)
Public propertyKind
Gets the kind of the current context.
(Inherited from LoggingContext.)
Public propertyMemberName
Gets the name of the method or property related to the current context.
(Inherited from LoggingContext.)
Public propertyParentContext
Gets the LoggingContext that created (initiated) the current context. This is the logical parent.
(Inherited from LoggingContext.)
Public propertySource
Gets the LoggingTypeSource corresponding, typically, to the declaring type of the member associated to the current context.
(Inherited from LoggingContext.)
Public propertyTask
Gets the Task that is currently associated to the current async method invocation. An async method invocation may be associated to several different tasks during its lifetime.
Public propertyThreadContext
Gets the ThreadLoggingContext for the thread in which the current LoggingContext is currently executed.
(Inherited from SuspendableLoggingContext.)
Methods
  NameDescription
Public methodCreateCorrelationCookie
Creates a cookie that can be used to correlate, using the SetCorrelation(CorrelationCookie) method, another context to the current context.
(Inherited from LoggingContext.)
Public methodDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from LoggingContext.)
Protected methodDispose(Boolean)
Disposes the current object.
(Inherited from SuspendableLoggingContext.)
Public methodForEachProperty (Inherited from LoggingContext.)
Public methodGetCustomRecordBuilder
Gets a LogRecordBuilder for the current context to build a custom record.
(Inherited from LoggingContext.)
Public methodGetRecordBuilder
Gets a LogRecordBuilder for the current context to build a standard record for a given method.
(Inherited from LoggingContext.)
Public methodMakeSharable
Allows the current context to be shared beyond its normal lifecycle by preventing it from being returned to the pool.
(Inherited from LoggingContext.)
Public methodOpen
Opens the context.
Protected methodReset
Resets the current context to its initial, uninitialized state. This method is called by the Dispose() method.
(Inherited from LoggingContext.)
Public methodResume
Resumes the current context. Typically called when the state machine resumes execution, when the wait dependency is satisfied (in case of async methods) or when the MoveNext() method is called (in case of iterators).
(Inherited from SuspendableLoggingContext.)
Public methodResumeConditional
Resume the current context, but only if it is currently suspended.
(Inherited from SuspendableLoggingContext.)
Public methodSetAwaitedTask
Sets the awaited Task and/or MethodBase (i.e. the operand of the await operator).
Public methodSetCorrelation
Associates the current context with another context.
(Inherited from LoggingContext.)
Public methodSetWaitDependency
Sets the wait dependency for the current context, i.e. sets a representation of what the current context is waiting for. This operation is available only in custom contexts.
(Inherited from LoggingContext.)
Public methodSuspend
Suspends the current context. Typically called when starting to wait for a wait dependency (the operand of the await operator in case of async methods), or after the MoveNext() method (in case of iterators).
(Inherited from SuspendableLoggingContext.)
Public methodToString()
Returns a string that represents the current object.
(Inherited from LoggingContext.)
Protected methodToString(StringBuilder)
Formats a description of the current LoggingContext into a given StringBuilder.
(Inherited from SuspendableLoggingContext.)
See Also