mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
don't log imgui asserts unless we've shown them this session
This commit is contained in:
parent
27b6dfcbea
commit
da8be03124
1 changed files with 8 additions and 0 deletions
|
|
@ -24,6 +24,8 @@ internal class AssertHandler : IDisposable
|
||||||
// Store callback to avoid it from being GC'd
|
// Store callback to avoid it from being GC'd
|
||||||
private readonly AssertCallbackDelegate callback;
|
private readonly AssertCallbackDelegate callback;
|
||||||
|
|
||||||
|
private bool everShownAssertThisSession = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="AssertHandler"/> class.
|
/// Initializes a new instance of the <see cref="AssertHandler"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -76,6 +78,10 @@ internal class AssertHandler : IDisposable
|
||||||
if (this.ignoredAsserts.Contains(key))
|
if (this.ignoredAsserts.Contains(key))
|
||||||
return;
|
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());
|
Lazy<string> stackTrace = new(() => new StackTrace(3).ToString());
|
||||||
|
|
||||||
if (!this.EnableVerboseLogging)
|
if (!this.EnableVerboseLogging)
|
||||||
|
|
@ -110,6 +116,8 @@ internal class AssertHandler : IDisposable
|
||||||
if (!this.ShowAsserts)
|
if (!this.ShowAsserts)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
this.everShownAssertThisSession = true;
|
||||||
|
|
||||||
string? GetRepoUrl()
|
string? GetRepoUrl()
|
||||||
{
|
{
|
||||||
// TODO: implot, imguizmo?
|
// TODO: implot, imguizmo?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue