better logging for shared objective system (#20253)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-09-16 13:59:27 +01:00
committed by GitHub
parent fb1de134a6
commit 5a586604d2

View File

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