]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
better logging for shared objective system (#20253)
authordeltanedas <39013340+deltanedas@users.noreply.github.com>
Sat, 16 Sep 2023 12:59:27 +0000 (13:59 +0100)
committerGitHub <noreply@github.com>
Sat, 16 Sep 2023 12:59:27 +0000 (22:59 +1000)
Co-authored-by: deltanedas <@deltanedas:kde.org>
Content.Shared/Objectives/Systems/SharedObjectivesSystem.cs

index dffb4e75c0efda0a483d9fee6ebb52dcb22ac72f..2e1bdc43831dc4a203b9956a4cba088d9741e5aa 100644 (file)
@@ -63,12 +63,9 @@ public abstract class SharedObjectivesSystem : EntitySystem
             return null;
         }
 
-        Log.Debug($"Created objective {proto} ({uid})");
-
         if (!CanBeAssigned(uid, mindId, mind, comp))
         {
-            Del(uid);
-            Log.Warning($"Objective {uid} did not match the requirements for {_mind.MindOwnerLoggingString(mind)}, deleted it");
+            Log.Warning($"Objective {proto} did not match the requirements for {_mind.MindOwnerLoggingString(mind)}, deleted it");
             return null;
         }
 
@@ -77,7 +74,7 @@ public abstract class SharedObjectivesSystem : EntitySystem
         if (ev.Cancelled)
         {
             Del(uid);
-            Log.Warning($"Could not assign objective {uid}, deleted it");
+            Log.Warning($"Could not assign objective {proto}, deleted it");
             return null;
         }
 
@@ -85,6 +82,7 @@ public abstract class SharedObjectivesSystem : EntitySystem
         var afterEv = new ObjectiveAfterAssignEvent(mindId, mind, comp, MetaData(uid));
         RaiseLocalEvent(uid, ref afterEv);
 
+        Log.Debug($"Created objective {ToPrettyString(uid):objective}");
         return uid;
     }