/// <summary> /// Write an exception message to the event log. /// </summary> static public void WriteException(string Message) { if (Message != null && Message.Length > 2) { Log.Print("[EXCEPT] " + Message); StatusReporter.IncrementCount(StatusReportingEventNames.ExceptionEvent); } }
/// <summary> /// Write an exception message to the event log. /// </summary> static public void WriteException(string Message, Exception Ex) { if (Ex != null) { if (Ex is OutOfMemoryException) { StatusReporter.Alert("OOM", "Out of memory.", 2); } } if (Message != null && Message.Length > 2) { Log.Print("[EXCEPT] " + Message); } else { Log.Print("[EXCEPT] NO MESSAGE"); } StatusReporter.IncrementCount(StatusReportingEventNames.ExceptionEvent); }