Skip to content

Commit

Permalink
Log contents of the version and doorstop_version files (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco authored Jun 5, 2024
1 parent 2894271 commit 0ccdd60
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Shared.Core/KoikatuAPIBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ private void BaseAwake()

Logger.LogDebug($"Processor: {SystemInfo.processorType} ({SystemInfo.processorCount} threads @ {SystemInfo.processorFrequency}MHz); RAM: {SystemInfo.systemMemorySize}MB ({MemoryInfo.GetCurrentStatus()?.dwMemoryLoad.ToString() ?? "--"}% used); OS: {SystemInfo.operatingSystem}");

void PrintFileIfExists(string fileName)
{
var fullFilePath = Path.Combine(Paths.GameRootPath, fileName);
if (File.Exists(fullFilePath))
{
var fileContents = File.ReadAllText(fullFilePath).Trim();
if (!string.IsNullOrEmpty(fileContents))
Logger.LogDebug($"Contents of the '{fileName}' file: {fileContents}");
}
}
PrintFileIfExists(".doorstop_version");
PrintFileIfExists("version");

SceneManager.sceneLoaded += (scene, mode) => Logger.LogDebug($"SceneManager.sceneLoaded - {scene.name} in {mode} mode");
SceneManager.sceneUnloaded += scene => Logger.LogDebug($"SceneManager.sceneUnloaded - {scene.name}");
SceneManager.activeSceneChanged += (prev, next) => Logger.LogDebug($"SceneManager.activeSceneChanged - from {prev.name} to {next.name}");
Expand Down

0 comments on commit 0ccdd60

Please sign in to comment.