Skip to content

Commit

Permalink
Put log paths in path repository
Browse files Browse the repository at this point in the history
  • Loading branch information
blowfishpro committed Jan 10, 2019
1 parent 09b1eff commit 39e4157
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ModuleManager/FilePathRepository.cs
Expand Up @@ -17,5 +17,8 @@ internal static class FilePathRepository
internal static readonly string partDatabasePath = Path.Combine(KSPUtil.ApplicationRootPath, "PartDatabase.cfg");

internal static readonly string shaPath = Path.Combine(Path.Combine(KSPUtil.ApplicationRootPath, "GameData"), "ModuleManager.ConfigSHA");

internal static readonly string logsDirPath = Path.Combine(KSPUtil.ApplicationRootPath, "Logs");
internal static readonly string logPath = Path.Combine(logsDirPath, "ModuleManager.log");
}
}
4 changes: 2 additions & 2 deletions ModuleManager/MMPatchRunner.cs
Expand Up @@ -8,6 +8,8 @@
using ModuleManager.Logging;
using ModuleManager.Threading;

using static ModuleManager.FilePathRepository;

namespace ModuleManager
{
public class MMPatchRunner
Expand All @@ -28,9 +30,7 @@ public IEnumerator Run()
{
PostPatchLoader.Instance.databaseConfigs = null;

string logsDirPath = Path.Combine(KSPUtil.ApplicationRootPath, "Logs");
if (!Directory.Exists(logsDirPath)) Directory.CreateDirectory(logsDirPath);
string logPath = Path.Combine(logsDirPath, "ModuleManager.log");

kspLogger.Info("Patching started on a new thread, all output will be directed to " + logPath);

Expand Down

0 comments on commit 39e4157

Please sign in to comment.