mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Merge pull request #524 from erri120/issue-522
Log files will now be stored in a separate logs folder
This commit is contained in:
commit
f416f80546
@ -53,15 +53,18 @@ namespace Wabbajack.Common
|
||||
if (!Directory.Exists(Consts.LocalAppDataPath))
|
||||
Directory.CreateDirectory(Consts.LocalAppDataPath);
|
||||
|
||||
if (!Directory.Exists("logs"))
|
||||
Directory.CreateDirectory("logs");
|
||||
|
||||
var programName = Assembly.GetEntryAssembly()?.Location ?? "Wabbajack";
|
||||
LogFile = Path.GetFileNameWithoutExtension(programName) + ".current.log";
|
||||
LogFile = Path.Combine("logs", Path.GetFileNameWithoutExtension(programName) + ".current.log");
|
||||
_startTime = DateTime.Now;
|
||||
|
||||
|
||||
if (LogFile.FileExists())
|
||||
{
|
||||
var new_path = Path.GetFileNameWithoutExtension(programName) + (new FileInfo(LogFile)).LastWriteTime.ToString(" yyyy-MM-dd HH_mm_ss") + ".log";
|
||||
File.Move(LogFile, new_path, MoveOptions.ReplaceExisting);
|
||||
var newPath = Path.Combine("logs", Path.GetFileNameWithoutExtension(programName) + (new FileInfo(LogFile)).LastWriteTime.ToString(" yyyy-MM-dd HH_mm_ss") + ".log");
|
||||
File.Move(LogFile, newPath, MoveOptions.ReplaceExisting);
|
||||
}
|
||||
|
||||
var watcher = new FileSystemWatcher(Consts.LocalAppDataPath);
|
||||
|
Loading…
Reference in New Issue
Block a user