PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics Namespace / Context­Id­Generation­Strategy Enumeration

ContextIdGenerationStrategy Enumeration

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

Namespace:  PostSharp.Patterns.Diagnostics
Assembly:  PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 2023.0.3.0 (2023.0.3.0)
public enum ContextIdGenerationStrategy
  Member nameValueDescription
Default0 The default value is LazyGlobal.
LazyGlobal0 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.
Global1 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.
Hierarchical2 Uses a counter in the ParentContext.
See Also