mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 14:17:51 +08:00
Actually fix Logs folder
This commit is contained in:
parent
0eae78eeb2
commit
ec8c88ab9b
@ -61,8 +61,10 @@ namespace UnityExplorer.UI.Panels
|
|||||||
|
|
||||||
private void SetupIO()
|
private void SetupIO()
|
||||||
{
|
{
|
||||||
|
var fileName = $"UnityExplorer {DateTime.Now:u}.txt";
|
||||||
|
fileName = IOUtility.EnsureValidFilename(fileName);
|
||||||
var path = Path.Combine(ExplorerCore.Loader.ExplorerFolder, "Logs");
|
var path = Path.Combine(ExplorerCore.Loader.ExplorerFolder, "Logs");
|
||||||
//path = IOUtility.EnsureValidFilePath(path);
|
CurrentStreamPath = IOUtility.EnsureValidFilePath(Path.Combine(path, fileName));
|
||||||
|
|
||||||
// clean old log(s)
|
// clean old log(s)
|
||||||
var files = Directory.GetFiles(path);
|
var files = Directory.GetFiles(path);
|
||||||
@ -75,11 +77,6 @@ namespace UnityExplorer.UI.Panels
|
|||||||
File.Delete(files[i]);
|
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());
|
File.WriteAllLines(CurrentStreamPath, Logs.Select(it => it.message).ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user