示例#1
0
        public static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs x)
        {
            WriteToLog.Log("An unhandled exception was thrown", "UNHANDLEDEXCEPTION");
            var ex = (Exception)x.ExceptionObject;

            WriteToLog.Log(ex.Message, "UNHANDLEDEXCEPTION");
            WriteToLog.Log(ex.ToString(), "UNHANDLEDEXCEPTION");
        }
示例#2
0
 public static void CurrentDomain_FirstChanceException(object sender, FirstChanceExceptionEventArgs e)
 {
     if (e.Exception is InvalidCastException || e.Exception is System.Collections.Generic.KeyNotFoundException)
     {
         return;
     }
     WriteToLog.Log("A first chance exception was thrown", "EXCEPTION");
     WriteToLog.Log(e.Exception.Message, "EXCEPTION");
     WriteToLog.Log(e.ToString(), "EXCEPTION");
 }
示例#3
0
 public static void Log(string line, string type = "LOG")
 {
     WriteToLog.Log(line, type);
 }