Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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]);
     }
 }