From ec8c88ab9b5101b88755ce95897f506c24b9246a Mon Sep 17 00:00:00 2001 From: Sinai <49360850+sinai-dev@users.noreply.github.com> Date: Tue, 19 Oct 2021 16:34:46 +1100 Subject: [PATCH] Actually fix Logs folder --- src/UI/Panels/LogPanel.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/UI/Panels/LogPanel.cs b/src/UI/Panels/LogPanel.cs index 9cc22e2..ee7b88c 100644 --- a/src/UI/Panels/LogPanel.cs +++ b/src/UI/Panels/LogPanel.cs @@ -61,8 +61,10 @@ namespace UnityExplorer.UI.Panels private void SetupIO() { + var fileName = $"UnityExplorer {DateTime.Now:u}.txt"; + fileName = IOUtility.EnsureValidFilename(fileName); var path = Path.Combine(ExplorerCore.Loader.ExplorerFolder, "Logs"); - //path = IOUtility.EnsureValidFilePath(path); + CurrentStreamPath = IOUtility.EnsureValidFilePath(Path.Combine(path, fileName)); // clean old log(s) var files = Directory.GetFiles(path); @@ -75,11 +77,6 @@ namespace UnityExplorer.UI.Panels File.Delete(files[i]); } - var fileName = $"UnityExplorer {DateTime.Now:u}.txt"; - fileName = IOUtility.EnsureValidFilename(fileName); - - CurrentStreamPath = IOUtility.EnsureValidFilePath(Path.Combine(path, fileName)); - File.WriteAllLines(CurrentStreamPath, Logs.Select(it => it.message).ToArray()); }