Merge pull request #77 from tstaples/master

Fixed issue #76: Logger would throw an exception when LogDir didn't exist.
This commit is contained in:
Carl 2016-03-29 01:42:27 +01:00
commit 26b914d61d
1 changed files with 7 additions and 0 deletions

View File

@ -231,6 +231,13 @@ namespace StardewModdingAPI
// ReSharper disable once InconsistentlySynchronizedField
_logQueue = new ConcurrentQueue<LogInfo>();
Console.WriteLine(Constants.LogPath);
// If the ErrorLogs dir doesn't exist StreamWriter will throw an exception.
if (!Directory.Exists(Constants.LogDir))
{
Directory.CreateDirectory(Constants.LogDir);
}
_stream = new StreamWriter(Constants.LogPath, false);
Console.WriteLine("Created log instance");
}