don't log imgui asserts unless we've shown them this session

This commit is contained in:
goat 2025-01-09 22:00:53 +01:00
parent 27b6dfcbea
commit da8be03124

View file

@ -24,6 +24,8 @@ internal class AssertHandler : IDisposable
// Store callback to avoid it from being GC'd
private readonly AssertCallbackDelegate callback;
private bool everShownAssertThisSession = false;
/// <summary>
/// Initializes a new instance of the <see cref="AssertHandler"/> class.
/// </summary>
@ -76,6 +78,10 @@ internal class AssertHandler : IDisposable
if (this.ignoredAsserts.Contains(key))
return;
// Don't log unless we've ever shown an assert this session
if (!this.ShowAsserts && !this.everShownAssertThisSession)
return;
Lazy<string> stackTrace = new(() => new StackTrace(3).ToString());
if (!this.EnableVerboseLogging)
@ -110,6 +116,8 @@ internal class AssertHandler : IDisposable
if (!this.ShowAsserts)
return;
this.everShownAssertThisSession = true;
string? GetRepoUrl()
{
// TODO: implot, imguizmo?