Allow deletion of FileLogHandler logs while engine is running (#4501)

This commit is contained in:
Jordan Dominion
2023-10-21 09:07:10 -04:00
committed by GitHub
parent ab47d4e009
commit ea152366e3

View File

@@ -12,7 +12,10 @@ namespace Robust.Shared.Log
public FileLogHandler(string path)
{
Directory.CreateDirectory(Path.GetDirectoryName(path)!);
writer = TextWriter.Synchronized(new StreamWriter(path, true, EncodingHelpers.UTF8));
writer = TextWriter.Synchronized(
new StreamWriter(
new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.Read | FileShare.Delete),
EncodingHelpers.UTF8));
}
public void Dispose()