Beispiel #1
0
        public static void ReportError(IFileAccessManager logFileManager, Exception e, [CallerFilePath] string sTitle = "", [CallerMemberName] string sDescription = "")
        {
            MobileCenter_Helper.AddAttachmentAndReportToMobileCenter(logFileManager, FormatErrorReporting(e, sTitle, sDescription).ToString());

            MobileCenter_Helper instance = MobileCenter_Helper.GetInstance();

            if (instance.m_sbLogs != null)
            {
                lock (locker)
                {
                    instance.m_sbLogs.Clear();
                    instance.m_sbLogs = null;
                }
            }
        }
Beispiel #2
0
        public static void ReportError(IFileAccessManager logFileManager, Exception e, StringBuilder dicInfos)
        {
            MobileCenter_Helper.AddAttachmentAndReportToMobileCenter(logFileManager, FormatErrorReporting(e, dicInfos).ToString());

            MobileCenter_Helper instance = MobileCenter_Helper.GetInstance();

            if (instance.m_sbLogs != null)
            {
                lock (locker)
                {
                    instance.m_sbLogs.Clear();
                    instance.m_sbLogs = null;
                }
            }
        }
Beispiel #3
0
        public static void AddLog(string sLog)
        {
            MobileCenter_Helper instance = MobileCenter_Helper.GetInstance();

            if (instance.m_sbLogs == null)
            {
                lock (locker)
                {
                    if (instance.m_sbLogs == null)
                    {
                        instance.m_sbLogs = new StringBuilder();
                    }
                }
            }

            lock (locker)
                instance.m_sbLogs.AppendLine(sLog);
        }
Beispiel #4
0
        private static StringBuilder FormatErrorReporting(Exception e, StringBuilder dicInfos, string sIncrement = "")
        {
            dicInfos.AppendLine(sIncrement + "Message = " + e.Message);
            dicInfos.AppendLine(sIncrement + "StackTrace = " + e.StackTrace);
            dicInfos.AppendLine(sIncrement + "Source = " + e.Source);
            dicInfos.AppendLine(sIncrement + "HResult = " + e.HResult.ToString());
            dicInfos.AppendLine(sIncrement + "Type = " + e.GetType().Name);

            if (e.InnerException != null)
            {
                dicInfos.AppendLine(sIncrement + "InnerException = " + e.InnerException.GetType().Name);

                dicInfos = FormatErrorReporting(e.InnerException, dicInfos, sIncrement + "_");
            }

            MobileCenter_Helper instance = MobileCenter_Helper.GetInstance();

            if (instance.m_sbLogs != null)
            {
                dicInfos.AppendLine(sIncrement + "TrajetTram Logs = " + instance.m_sbLogs.ToString());
            }

            return(dicInfos);
        }