Skip to content

Commit 44c9d87

Browse files
authored
Merge pull request #2 from VRCFaceTracking/log-clear-fix
Clear SRAnipal logs on initialize
2 parents b9948b7 + 9ffd720 commit 44c9d87

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

SRanipalExtTrackingModule/SRanipalTrackingInterface.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@ public override (bool eyeSuccess, bool expressionSuccess) Initialize(bool eyeAva
3939
// Get the directory of the sr_runtime.exe program from our start menu shortcut. This is where the SRanipal dlls are located.
4040
var srInstallDir = (string) Registry.LocalMachine.OpenSubKey(@"Software\VIVE\SRWorks\SRanipal")?.GetValue("ModuleFileName");
4141

42+
// Dang you SRanipal
43+
var localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
44+
var srLogsDirectory = Path.Combine(localAppData + @"Low\HTC Corporation\SR_Logs\SRAnipal_Logs");
45+
46+
// Get yeeted logs
47+
var srLogFiles = Directory.GetFiles(srLogsDirectory);
48+
foreach (var log in srLogFiles)
49+
using (var stream = File.Open(log, FileMode.Open, FileAccess.Write, FileShare.ReadWrite))
50+
{
51+
Logger.LogDebug("Clearing " + log);
52+
stream.SetLength(0);
53+
stream.Close();
54+
}
55+
4256
if (srInstallDir == null)
4357
{
4458
Logger.LogError("Bruh, SRanipal not installed. Assuming default path");

0 commit comments

Comments
 (0)