Пример #1
0
 public DiagnosticsContext(bool suppressIdAllocation, DiagnosticsLevel diagnosticsLevel)
 {
     this.diagnosticsLevel = diagnosticsLevel;
     if (suppressIdAllocation)
     {
         return;
     }
     while (this.requestId == 0)
     {
         this.requestId = Interlocked.Increment(ref DiagnosticsContext.requestIdCounter);
     }
 }
Пример #2
0
        /// <summary>
        /// Convert to diagnostics mask
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>
        public static UaDiagnosticsLevel ToStackType(this DiagnosticsLevel level)
        {
            switch (level)
            {
            case DiagnosticsLevel.Diagnostics:
                return(UaDiagnosticsLevel.SymbolicIdAndText | UaDiagnosticsLevel.InnerDiagnostics);

            case DiagnosticsLevel.Verbose:
                return(UaDiagnosticsLevel.All);

            default:
                return(UaDiagnosticsLevel.None);
            }
        }
Пример #3
0
        internal static string ToSerializedValue(this DiagnosticsLevel value)
        {
            switch (value)
            {
            case DiagnosticsLevel.None:
                return("None");

            case DiagnosticsLevel.Status:
                return("Status");

            case DiagnosticsLevel.Operations:
                return("Operations");

            case DiagnosticsLevel.Diagnostics:
                return("Diagnostics");

            case DiagnosticsLevel.Verbose:
                return("Verbose");
            }
            return(null);
        }
Пример #4
0
 public DirectoryContext(ClientContext clientContext, OrganizationId organizationId, ITopologyConfigurationSession globalConfigSession, IConfigurationSession tenantConfigSession, IRecipientSession tenantGalSession, TrackingEventBudget trackingBudget, DiagnosticsLevel diagnosticsLevel, TrackingErrorCollection errors, bool suppressIdAllocation)
 {
     this.clientContext       = clientContext;
     this.organizationId      = organizationId;
     this.globalConfigSession = globalConfigSession;
     this.tenantConfigSession = tenantConfigSession;
     this.tenantGalSession    = tenantGalSession;
     this.diagnosticsContext  = new DiagnosticsContext(suppressIdAllocation, diagnosticsLevel);
     this.TrackingBudget      = trackingBudget;
     this.Errors = errors;
     if (!this.TrySetExternalOrgId(organizationId))
     {
         TraceWrapper.SearchLibraryTracer.TraceError(0, "Failed to set ExternalOrgId. Assuming forest wide organization", new object[0]);
     }
 }