Пример #1
0
        // Token: 0x060000E2 RID: 226 RVA: 0x00003F80 File Offset: 0x00002180
        public static string GetDiagnosticInfo(Exception ex, string diagnosticInfo)
        {
            AnchorUtil.ThrowOnNullArgument(ex, "ex");
            Exception innerException = ex.InnerException;
            int       num            = 0;

            while (num < 10 && innerException != null)
            {
                MapiPermanentException ex2 = innerException as MapiPermanentException;
                MapiRetryableException ex3 = innerException as MapiRetryableException;
                string text = innerException.Message;
                if (ex2 != null)
                {
                    text = ex2.DiagCtx.ToCompactString();
                }
                else if (ex3 != null)
                {
                    text = ex3.DiagCtx.ToCompactString();
                }
                if (!string.IsNullOrEmpty(text))
                {
                    if (diagnosticInfo == null)
                    {
                        diagnosticInfo = string.Format(CultureInfo.InvariantCulture, "InnerException:{0}:{1}", new object[]
                        {
                            innerException.GetType().Name,
                            text
                        });
                    }
                    else
                    {
                        diagnosticInfo = string.Format(CultureInfo.InvariantCulture, "{0} InnerException:{1}:{2}", new object[]
                        {
                            diagnosticInfo,
                            innerException.GetType().Name,
                            text
                        });
                    }
                }
                num++;
                innerException = innerException.InnerException;
            }
            string value = string.Empty;
            MigrationPermanentException ex4 = ex as MigrationPermanentException;
            MigrationTransientException ex5 = ex as MigrationTransientException;

            if (ex4 != null)
            {
                value = ex4.InternalError + ". ";
            }
            else if (ex5 != null)
            {
                value = ex5.InternalError + ". ";
            }
            StringBuilder stringBuilder = new StringBuilder(value);

            stringBuilder.Append(diagnosticInfo);
            stringBuilder.Append(ex.ToString());
            return(AnchorLogger.SanitizeDiagnosticInfo(stringBuilder.ToString()));
        }
Пример #2
0
        // Token: 0x060000F8 RID: 248 RVA: 0x000043FC File Offset: 0x000025FC
        protected void LogEventInternal(MigrationEventType eventType, ExEventLog.EventTuple?eventId, bool includeAnchorContext, Exception exception, params string[] args)
        {
            StringBuilder stringBuilder = new StringBuilder();

            if (eventId != null)
            {
                stringBuilder.Append("Event " + (eventId.Value.EventId & 65535U).ToString() + " ");
            }
            else
            {
                eventId = this.EventIdFromLogLevel(eventType);
            }
            if (eventId == null)
            {
                return;
            }
            AnchorLogger.LogEvent(this.EventLogger, eventId.Value, includeAnchorContext, args);
            if (args != null)
            {
                foreach (string value in args)
                {
                    stringBuilder.Append(value);
                    stringBuilder.Append(',');
                }
            }
            this.Log(eventType, exception, stringBuilder.ToString());
        }
Пример #3
0
 // Token: 0x060000F1 RID: 241 RVA: 0x000042D1 File Offset: 0x000024D1
 public void Log(MigrationEventType eventType, Exception exception, string formatString, params object[] args)
 {
     if (exception != null)
     {
         this.Log(eventType, formatString + ", exception " + AnchorLogger.GetDiagnosticInfo(exception, null), args);
         return;
     }
     this.Log(eventType, formatString, args);
 }
Пример #4
0
 // Token: 0x060000F6 RID: 246 RVA: 0x0000438E File Offset: 0x0000258E
 internal static void LogEvent(ExEventLog eventLogger, ExEventLog.EventTuple eventId, params string[] messageArgs)
 {
     AnchorLogger.LogEvent(eventLogger, eventId, true, messageArgs);
 }