Skip to content

Commit

Permalink
Merge #4071 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
2 parents 76318a5 + a1ced32 commit adbe192
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ All notable changes to this project will be documented in this file.
- [Core] Get KSP2 version from game assembly (#4034 by: HebaruSan)
- [Multiple] Build nuget package, support netstandard2.0 build (#4039 by: HebaruSan)
- [Core] Use fully sanitized archive.org bucket names (#4043 by: HebaruSan)
- [Netkan] Omit duplicate inflation warnings in queue (#4071 by: HebaruSan)

## v1.34.4 (Niven)

Expand Down
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 class QueueAppender : AppenderSkeleton

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 adbe192

Please sign in to comment.