Пример #1
0
 public void WriteException(ExceptionLogEntry entry)
 {
     WriteLine(entry.ExceptionType.ToString());
     WriteLine(entry.Message);
     WriteLine(entry.StackTrace);
     WriteLine(entry.Hash);
     WriteLine(entry.hResult.ToString());
 }
Пример #2
0
        private static void LogException(ExceptionType exceptionType, Exception exception)
        {
            var entry = new ExceptionLogEntry()
            {
                ExceptionType = exceptionType,
                Message       = exception.Message,
                StackTrace    = exception.StackTrace,
                Hash          = CalculateMd5Hash(exception.Message + exception.StackTrace),
                hResult       = Marshal.GetHRForException(exception)
            };

            m_ExceptionLogEntries.Add(entry);
            _exceptionLogConnector.WriteException(entry);
        }