public void LogException(Exception exception)
{
if (database == null)
return;
ErrorLogEntry error = new ErrorLogEntry();
var exceptionStackTrace = new ExceptionStackTrace(exception);
error.CommandLine = Environment.CommandLine;
error.ExceptionMessage = exceptionStackTrace.Message;
error.ExceptionType = exception.GetType().FullName;
error.ExceptionSource = exceptionStackTrace.Source;
error.ExceptionStackTrace = exceptionStackTrace.StackTrace;
error.FileName = exceptionStackTrace.FileName;
error.HostName = System.Environment.MachineName;
error.IPAddress = Utils.GetLocalIP().GetAddressBytes();
error.LineNumber = exceptionStackTrace.LineNumber;
error.ProcessID = Process.GetCurrentProcess().Id;
error.TestID = database.GetCurrentTestID();
database.LogError(error);
}