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)
C#
public enum ContextIdGenerationStrategy
Member name | Value | Description | |
---|---|---|---|
Default | 0 | The default value is LazyGlobal. | |
LazyGlobal | 0 | 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. | |
Global | 1 | 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 | 2 | Uses a counter in the ParentContext. |