Skip to content

Commit 9ffd720

Browse files
committed
Clear SRAnipal logs on initialize (workaround for insane log file sizes from SRAnipal)
1 parent 78b8f12 commit 9ffd720

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
@@ -37,6 +37,20 @@ public override (bool eyeSuccess, bool expressionSuccess) Initialize(bool eyeAva
3737
// Get the directory of the sr_runtime.exe program from our start menu shortcut. This is where the SRanipal dlls are located.
3838
var srInstallDir = (string) Registry.LocalMachine.OpenSubKey(@"Software\VIVE\SRWorks\SRanipal")?.GetValue("ModuleFileName");
3939

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

0 commit comments

Comments
 (0)