mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Added LogsFolder Consts
This commit is contained in:
parent
6f80a40dc9
commit
78ba02f277
@ -103,5 +103,8 @@ namespace Wabbajack.Common
|
||||
|
||||
public static string PatchCacheFolder => Path.Combine(LocalAppDataPath, "patch_cache");
|
||||
public static int MaxConnectionsPerServer = 4;
|
||||
|
||||
public static string LogsFolder = "logs";
|
||||
public static int MaxOldLogs = 50;
|
||||
}
|
||||
}
|
||||
|
@ -53,17 +53,17 @@ namespace Wabbajack.Common
|
||||
if (!Directory.Exists(Consts.LocalAppDataPath))
|
||||
Directory.CreateDirectory(Consts.LocalAppDataPath);
|
||||
|
||||
if (!Directory.Exists("logs"))
|
||||
Directory.CreateDirectory("logs");
|
||||
if (!Directory.Exists(Consts.LogsFolder))
|
||||
Directory.CreateDirectory(Consts.LogsFolder);
|
||||
|
||||
var programName = Assembly.GetEntryAssembly()?.Location ?? "Wabbajack";
|
||||
LogFile = Path.Combine("logs", Path.GetFileNameWithoutExtension(programName) + ".current.log");
|
||||
LogFile = Path.Combine(Consts.LogsFolder, Path.GetFileNameWithoutExtension(programName) + ".current.log");
|
||||
_startTime = DateTime.Now;
|
||||
|
||||
|
||||
if (LogFile.FileExists())
|
||||
{
|
||||
var newPath = Path.Combine("logs", Path.GetFileNameWithoutExtension(programName) + (new FileInfo(LogFile)).LastWriteTime.ToString(" yyyy-MM-dd HH_mm_ss") + ".log");
|
||||
var newPath = Path.Combine(Consts.LogsFolder, Path.GetFileNameWithoutExtension(programName) + (new FileInfo(LogFile)).LastWriteTime.ToString(" yyyy-MM-dd HH_mm_ss") + ".log");
|
||||
File.Move(LogFile, newPath, MoveOptions.ReplaceExisting);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user