Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 619b355

Browse files
committed
Merge branch 'devel'
2 parents aaaa5f2 + ea8ce4d commit 619b355

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/HoloCure.Launcher.Desktop/Utils/SentryLogger.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public SentryLogger(LauncherBase game)
3232

3333
private void processLogEntry(LogEntry entry)
3434
{
35-
if (entry.Level < LogLevel.Verbose) return;
35+
if (!shouldSubmitEntry(ref entry)) return;
3636

3737
if (entry.Exception is { } ex)
3838
{
@@ -91,6 +91,15 @@ private SentryLevel getSentryLevel(LogLevel entryLevel) =>
9191
_ => throw new ArgumentOutOfRangeException(nameof(entryLevel), entryLevel, null)
9292
};
9393

94+
private bool shouldSubmitEntry(ref LogEntry entry)
95+
{
96+
// Modify "[context] Log for [user]" message to omit identifiable name.
97+
// Maybe redact/remove GL logging as well? Could be considered a tracking vector, but it's important info (as is OS type, etc.), so not sure.
98+
if (entry.Level == LogLevel.Verbose && entry.Message.Contains(" Log for ")) entry.Message = entry.Message.Replace(Environment.UserName, "[name removed]");
99+
100+
return true;
101+
}
102+
94103
private bool shouldSubmitException(Exception exception)
95104
{
96105
switch (exception)
@@ -100,7 +109,7 @@ private bool shouldSubmitException(Exception exception)
100109
const int hr_error_handle_disk_full = unchecked((int)0x80070027);
101110
const int hr_error_disk_full = unchecked((int)0x80070070);
102111

103-
if (ioe.HResult == hr_error_handle_disk_full || ioe.HResult == hr_error_disk_full) return false;
112+
if (ioe.HResult is hr_error_handle_disk_full or hr_error_disk_full) return false;
104113

105114
break;
106115
}

0 commit comments

Comments
 (0)