Logger now creates the errorlogs dir if it doesn't exist, fixing issue #76
This commit is contained in:
parent
6da92c08b9
commit
07396adb55
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue