Skip to content

Commit

Permalink
Omit duplicate inflation warnings in queue
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Mar 31, 2024
1 parent 76318a5 commit a1ced32
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Netkan/QueueAppender.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;

using log4net.Core;
using log4net.Appender;

Expand All @@ -10,9 +11,13 @@ public QueueAppender() { }

protected override void Append(LoggingEvent evt)
{
Warnings.Add(evt.RenderedMessage);
// Skip duplicate messages for better multi-kref handling
if (!Warnings.Contains(evt.RenderedMessage))
{
Warnings.Add(evt.RenderedMessage);
}
}

public List<string> Warnings = new List<string>();
public readonly List<string> Warnings = new List<string>();
}
}

0 comments on commit a1ced32

Please sign in to comment.