PostSharpAPI ReferencePost­Sharp.​Patterns.​DiagnosticsContext­Id­Generation­Strategy
Open sandboxFocus

ContextIdGenerationStrategy Class

Enumerates the different strategies to generate the value of the Id strategy.

Inheritance
ContextIdGenerationStrategy
Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics.dll
Syntax
public sealed class ContextIdGenerationStrategy : Enum

Fields

Name Description
Default

The default value is LazyGlobal.

Global

Uses a global static incremental counter shared with all LoggingBackend instances in the current AppDomain. In heavily multi-threaded applications, this strategy can cause thread contention because of the need to serialize the access to the global counter.

Hierarchical

Uses a counter in the ParentContext.

LazyGlobal

The same as Global, but the Id property is generated lazily the first time it is being evaluated. This strategy is a bit slower than Global in cases where the Id property is always evaluated.

value__