mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Fix potential error when writing runtime log (#4575)
This commit is contained in:
@@ -660,10 +660,14 @@ namespace Robust.Server
|
||||
{
|
||||
// Write down exception log
|
||||
var logPath = _config.GetCVar(CVars.LogPath);
|
||||
var relPath = PathHelpers.ExecutableRelativeFile(logPath);
|
||||
Directory.CreateDirectory(relPath);
|
||||
var pathToWrite = Path.Combine(relPath,
|
||||
if (!Path.IsPathRooted(logPath))
|
||||
{
|
||||
logPath = PathHelpers.ExecutableRelativeFile(logPath);
|
||||
}
|
||||
|
||||
var pathToWrite = Path.Combine(logPath,
|
||||
"Runtime-" + DateTime.Now.ToString("yyyy-MM-dd-THH-mm-ss") + ".txt");
|
||||
Directory.CreateDirectory(logPath);
|
||||
File.WriteAllText(pathToWrite, _runtimeLog.Display(), EncodingHelpers.UTF8);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user