Skip to content

Commit

Permalink
add debug logging to entitywhitelist (#2263)
Browse files Browse the repository at this point in the history
* everything is on fire but whatever

* cd trolling

* kill

* 4 commits to add 14 lines is crazy
  • Loading branch information
MilonPL authored Nov 22, 2024
1 parent 2f47a36 commit 88eaeba
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Content.Shared/Whitelist/EntityWhitelistSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq; // DeltaV
using Content.Shared.Item;
using Content.Shared.Roles;
using Content.Shared.Tag;
Expand Down Expand Up @@ -113,6 +114,19 @@ public bool IsWhitelistPass(EntityWhitelist? whitelist, EntityUid uid)
if (whitelist == null)
return false;

// Begin DeltaV
var isValid = IsValid(whitelist, uid);
Log.Debug($"Whitelist validation result for entity {ToPrettyString(uid)}: {isValid}");

if (whitelist.RequireAll)
{
Log.Debug($"Whitelist requires all conditions - Components: {string.Join(", ", whitelist.Components ?? Array.Empty<string>())}, " +
$"Tags: {(whitelist.Tags != null ? string.Join(", ", whitelist.Tags.Select(t => t.ToString())) : "none")}");
}

return isValid;
// EndDeltaV

return IsValid(whitelist, uid);
}

Expand Down

0 comments on commit 88eaeba

Please sign in to comment.