Open sandboxFocus

Class AsyncMethodLoggingContext

A LoggingContext that represents an asynchronous method.

Namespace: PostSharp.Patterns.Diagnostics.Contexts
Assembly: PostSharp.Patterns.Diagnostics.dll
Syntax
public class AsyncMethodLoggingContext : AsyncLoggingContext, ILoggingContext, IDisposable
Remarks

A custom backend that needs to store more data in this context can derive a class from it and override CreateAsyncMethodContext() to return an instance of the derived class.

Constructors

Name Description
AsyncMethodLoggingContext(LoggingBackend)

Initializes a new instance of the AsyncMethodLoggingContext class.

Properties

Name Description
AsyncCallId

Gets the unique identifier of the asynchronous call represented by the current AsyncMethodLoggingContext.

AwaitedMethod

Gets the awaited method (that is, the operand of the await operator), or null if it could not be determined or if the IncludeAwaitedTask profile property is set to false.

AwaitedTask

Gets the awaited Task (that is, the operand of the await operator), or null if it could not be determined or if the IncludeAwaitedTask profile property is set to false.

Task

Gets the Task that is currently associated with the current async method invocation. An async method invocation may be associated with several different tasks during its lifetime.

Methods

Name Description
Open(AsyncCallId, ref LogMemberInfo)

Opens the context.

SetAwaitedTask(Task, MethodBase)

Sets the awaited Task and/or MethodBase (that is, the operand of the await operator).

See Also