PostSharpAPI ReferencePost­Sharp.​Patterns.​Diagnostics.​ContextsAsync­Method­Logging­Context
Open sandboxFocus

AsyncMethodLoggingContext Class

A LoggingContext that represents an asynchronous method.

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

Constructors

Name Description
AsyncMethodLoggingContext(LoggingBackend)

Creates an instance of AsyncMethodLoggingContext.

Properties

Name Description
AsyncCallId

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

AwaitedMethod

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.

AwaitedTask

Gets the awaited System.Threading.Tasks.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.

Task

Gets the System.Threading.Tasks.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.

Methods

Name Description
Open(AsyncCallId, ref LogMemberInfo)

Opens the context.

SetAwaitedTask(Task, MethodBase)

Sets the awaited System.Threading.Tasks.Task and/or System.Reflection.MethodBase (i.e. the operand of the await operator).