Write the ErrorLog into the exe's directory.

This commit is contained in:
larsbrubaker 2014-02-26 12:09:09 -08:00
parent d461f3553c
commit 740e16319c

View file

@ -12,11 +12,12 @@ namespace MatterHackers.MatterControl.Testing
string errorLogFileName = null; string errorLogFileName = null;
public TestingDispatch() public TestingDispatch()
{ {
errorLogFileName = "ErrorLog.txt"; string exePath = Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().Location );
errorLogFileName = Path.Combine(exePath, "ErrorLog.txt");
string firstLine = string.Format("MatterControl Errors: {0:yyyy-MM-dd hh:mm:ss tt}", DateTime.Now); string firstLine = string.Format("MatterControl Errors: {0:yyyy-MM-dd hh:mm:ss tt}", DateTime.Now);
using (StreamWriter file = new StreamWriter(errorLogFileName)) using (StreamWriter file = new StreamWriter(errorLogFileName))
{ {
file.WriteLine(errorLogFileName, firstLine); file.WriteLine(firstLine);
} }
} }