]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Obsolete `Logger` cleanup for `EntitySystem`s (#25941)
authorLordCarve <27449516+LordCarve@users.noreply.github.com>
Sun, 10 Mar 2024 00:15:13 +0000 (01:15 +0100)
committerGitHub <noreply@github.com>
Sun, 10 Mar 2024 00:15:13 +0000 (01:15 +0100)
* Small obsolete Logger cleanup

* Fixed three EntitySystem logs that weren't doing it right.

25 files changed:
Content.Client/Alerts/ClientAlertsSystem.cs
Content.Client/Clothing/ClientClothingSystem.cs
Content.Client/IconSmoothing/IconSmoothSystem.cs
Content.Client/Info/InfoSystem.cs
Content.Client/Light/RgbLightControllerSystem.cs
Content.Client/Sprite/RandomSpriteSystem.cs
Content.Server/Atmos/EntitySystems/AutomaticAtmosSystem.cs
Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.TileFill.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
Content.Server/Explosion/EntitySystems/SmokeOnTriggerSystem.cs
Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs
Content.Server/Info/InfoSystem.cs
Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.Emitter.cs
Content.Server/Spawners/EntitySystems/ConditionalSpawnerSystem.cs
Content.Server/Station/Systems/StationJobsSystem.Roundstart.cs
Content.Server/Station/Systems/StationSystem.cs
Content.Server/Store/Systems/StoreSystem.Listings.cs
Content.Server/Strip/StrippableSystem.cs
Content.Server/Traits/TraitSystem.cs
Content.Server/Worldgen/Systems/Biomes/BiomeSelectionSystem.cs
Content.Server/Worldgen/Systems/WorldgenConfigSystem.cs
Content.Shared/DoAfter/SharedDoAfterSystem.cs
Content.Shared/Interaction/SharedInteractionSystem.cs

index ab296a96195cd52d02b113be06f329597bf5f05a..237f24e3eae96171bd1d33f1c3bba263aba6bddc 100644 (file)
@@ -33,7 +33,7 @@ public sealed class ClientAlertsSystem : AlertsSystem
 
         AlertOrder = _prototypeManager.EnumeratePrototypes<AlertOrderPrototype>().FirstOrDefault();
         if (AlertOrder == null)
-            Log.Error("alert", "no alertOrder prototype found, alerts will be in random order");
+            Log.Error("No alertOrder prototype found, alerts will be in random order");
     }
 
     public IReadOnlyDictionary<AlertKey, AlertState>? ActiveAlerts
index 979f7430e17d55cef6deb87a8a7520c0ac8e72f6..ed95cf240a5ceb3a2efd9c2939ded19209d8c32c 100644 (file)
@@ -271,7 +271,7 @@ public sealed class ClientClothingSystem : ClothingSystem
         {
             if (!revealedLayers.Add(key))
             {
-                Logger.Warning($"Duplicate key for clothing visuals: {key}. Are multiple components attempting to modify the same layer? Equipment: {ToPrettyString(equipment)}");
+                Log.Warning($"Duplicate key for clothing visuals: {key}. Are multiple components attempting to modify the same layer? Equipment: {ToPrettyString(equipment)}");
                 continue;
             }
 
index 7334c2fd4320eef39ad99bc849b7158e9b32e026..0ab33c65202a5d60bd24e30b27193602c6cc8bb9 100644 (file)
@@ -231,7 +231,7 @@ namespace Content.Client.IconSmoothing
 
             if (!spriteQuery.TryGetComponent(uid, out var sprite))
             {
-                Logger.Error($"Encountered a icon-smoothing entity without a sprite: {ToPrettyString(uid)}");
+                Log.Error($"Encountered a icon-smoothing entity without a sprite: {ToPrettyString(uid)}");
                 RemCompDeferred(uid, smooth);
                 return;
             }
@@ -242,7 +242,7 @@ namespace Content.Client.IconSmoothing
             {
                 if (!_mapManager.TryGetGrid(xform.GridUid, out grid))
                 {
-                    Logger.Error($"Failed to calculate IconSmoothComponent sprite in {uid} because grid {xform.GridUid} was missing.");
+                    Log.Error($"Failed to calculate IconSmoothComponent sprite in {uid} because grid {xform.GridUid} was missing.");
                     return;
                 }
             }
index 4572f3afdcaa82b46054ad12fa443f38b9abe3be..b6979949818748a9bf625d30693a49d47c1eb3e0 100644 (file)
@@ -12,13 +12,13 @@ public sealed class InfoSystem : EntitySystem
     {
         base.Initialize();
         SubscribeNetworkEvent<RulesMessage>(OnRulesReceived);
-        Logger.DebugS("info", "Requested server info.");
+        Log.Debug("Requested server info.");
         RaiseNetworkEvent(new RequestRulesMessage());
     }
 
     private void OnRulesReceived(RulesMessage message, EntitySessionEventArgs eventArgs)
     {
-        Logger.DebugS("info", "Received server rules.");
+        Log.Debug("Received server rules.");
         Rules = message;
         _rules.UpdateRules();
     }
index ad8ca475828544a7b025635a6ac4fa56d7e659f7..7d55bcebf113ffe538ca0f23e1832d421d94ddd7 100644 (file)
@@ -146,7 +146,7 @@ namespace Content.Client.Light
                 else
                 {
                     // admeme fuck-ups or bad yaml?
-                    Logger.Warning($"RGB light attempted to use invalid sprite index {index} on entity {ToPrettyString(uid)}");
+                    Log.Warning($"RGB light attempted to use invalid sprite index {index} on entity {ToPrettyString(uid)}");
                     rgb.Layers.Remove(index);
                 }
             }
index 04f6681136c2705b5de4c2d0bd5e9e6bf419c91d..9b800b3c78c9719bf12cd1647d918483b22d441f 100644 (file)
@@ -51,7 +51,7 @@ public sealed class RandomSpriteSystem : SharedRandomSpriteSystem
             {
                 if (layer.Key is not { } strKey || !int.TryParse(strKey, out index))
                 {
-                    Logger.Error($"Invalid key `{layer.Key}` for entity with random sprite {ToPrettyString(uid)}");
+                    Log.Error($"Invalid key `{layer.Key}` for entity with random sprite {ToPrettyString(uid)}");
                     continue;
                 }
             }
index 5d60ae57d9bf608acf466747d18276cce7689489..203c747e29ed9de64c3e90c01ad0dc4e6144153a 100644 (file)
@@ -39,7 +39,7 @@ public sealed class AutomaticAtmosSystem : EntitySystem
         if (physics.Mass / ShuttleSystem.TileMassMultiplier >= 7.0f)
         {
             AddComp<GridAtmosphereComponent>(ev.Entity);
-            Logger.InfoS("atmos", $"Giving grid {ev.Entity} GridAtmosphereComponent.");
+            Log.Info($"Giving grid {ev.Entity} GridAtmosphereComponent.");
         }
         // It's not super important to remove it should the grid become too small again.
         // If explosions ever gain the ability to outright shatter grids, do rethink this.
index f38e0299a0d55c419cb8321accd308f54d806a62..faf06a60793b23cba14d1405c4b2493c341672d9 100644 (file)
@@ -167,7 +167,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
                 }
                 else
                 {
-                    Logger.Warning("atmos", $"{ToPrettyString(uid)} received GasFilterSelectGasMessage with an invalid ID: {args.ID}");
+                    Log.Warning($"{ToPrettyString(uid)} received GasFilterSelectGasMessage with an invalid ID: {args.ID}");
                 }
             }
             else
index 2bfc753b74ae1d0dcf0c4f2d7664fb19498ef0ea..31451c425f563ab3e9f46cdb73db1b3456e6f6a8 100644 (file)
@@ -156,7 +156,7 @@ public sealed partial class ExplosionSystem
 #endif
         }
 
-        Logger.InfoS("Explosion", $"Processed {TilesPerTick - tilesRemaining} tiles in {Stopwatch.Elapsed.TotalMilliseconds}ms");
+        Log.Info($"Processed {TilesPerTick - tilesRemaining} tiles in {Stopwatch.Elapsed.TotalMilliseconds}ms");
 
         // we have finished processing our tiles. Is there still an ongoing explosion?
         if (_activeExplosion != null)
index 1b324d924bc0484dacb59da303543e205d38a48b..afad0e27e09a222eb820f6a178595cc37a1bf657 100644 (file)
@@ -37,7 +37,7 @@ public sealed partial class ExplosionSystem : EntitySystem
 
         if (!_explosionTypes.TryGetValue(typeID, out var typeIndex))
         {
-            Logger.Error("Attempted to spawn explosion using a prototype that was not defined during initialization. Explosion prototype hot-reload is not currently supported.");
+            Log.Error("Attempted to spawn explosion using a prototype that was not defined during initialization. Explosion prototype hot-reload is not currently supported.");
             return null;
         }
 
index 7495ecbb3490e905be553eccc28a6629ea62aa90..1a5a5c40118ccf87c392dc8c9163c79fd1f5e00c 100644 (file)
@@ -290,7 +290,7 @@ public sealed partial class ExplosionSystem : EntitySystem
 
         if (!_prototypeManager.TryIndex<ExplosionPrototype>(typeId, out var type))
         {
-            Logger.Error($"Attempted to spawn unknown explosion prototype: {type}");
+            Log.Error($"Attempted to spawn unknown explosion prototype: {type}");
             return;
         }
 
index c0775947ba44d560abcaf3d9d8d7dc3d60881392..17ca9723569798f08f111dc927aeeb7d556677f4 100644 (file)
@@ -37,7 +37,7 @@ public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem
         var ent = Spawn(comp.SmokePrototype, coords.SnapToGrid());
         if (!TryComp<SmokeComponent>(ent, out var smoke))
         {
-            Logger.Error($"Smoke prototype {comp.SmokePrototype} was missing SmokeComponent");
+            Log.Error($"Smoke prototype {comp.SmokePrototype} was missing SmokeComponent");
             Del(ent);
             return;
         }
index 36ab038562bac9946925600137e242863e564fd3..039128e32f64f5203cbbed325797f30690051f25 100644 (file)
@@ -186,7 +186,7 @@ public sealed partial class HumanoidAppearanceSystem : SharedHumanoidAppearanceS
 
         if (speciesPrototype == null)
         {
-            Logger.Error("Tried to get age representation of species that couldn't be indexed: " + species);
+            Log.Error("Tried to get age representation of species that couldn't be indexed: " + species);
             return Loc.GetString("identity-age-young");
         }
 
index 04fa6a57e597b26b8b94e2666f1d73d8fb7ad285..350ae033cfdd35cd3bf2a0a43719f336427e1e7e 100644 (file)
@@ -17,7 +17,7 @@ public sealed class InfoSystem : EntitySystem
 
     private void OnRequestRules(RequestRulesMessage message, EntitySessionEventArgs eventArgs)
     {
-        Log.Debug("info", "Client requested rules.");
+        Log.Debug("Client requested rules.");
         var title = Loc.GetString(_cfg.GetCVar(CCVars.RulesHeader));
         var path = _cfg.GetCVar(CCVars.RulesFile);
         var rules = "Server could not read its rules.";
@@ -27,7 +27,7 @@ public sealed class InfoSystem : EntitySystem
         }
         catch (Exception)
         {
-            Log.Debug("info", "Could not read server rules file.");
+            Log.Debug("Could not read server rules file.");
         }
         var response = new RulesMessage(title, rules);
         RaiseNetworkEvent(response, eventArgs.SenderSession.Channel);
index 7fad69e349f4dff5dac7650453655d669dd056c4..46b25163cc02e365f3e2bf07a5e28caf38a00161 100644 (file)
@@ -16,7 +16,7 @@ public sealed partial class ParticleAcceleratorSystem
         var xformQuery = GetEntityQuery<TransformComponent>();
         if (!xformQuery.TryGetComponent(uid, out var xform))
         {
-            Logger.Error("ParticleAccelerator attempted to emit a particle without (having) a transform from which to base its initial position and orientation.");
+            Log.Error("ParticleAccelerator attempted to emit a particle without (having) a transform from which to base its initial position and orientation.");
             return;
         }
 
index 6616746506804ff15a791df5138d328a7ddd8084..506fd61d55967db754a72e776259d839a9d05988 100644 (file)
@@ -73,7 +73,7 @@ namespace Content.Server.Spawners.EntitySystems
 
             if (component.Prototypes.Count == 0)
             {
-                Logger.Warning($"Prototype list in ConditionalSpawnComponent is empty! Entity: {ToPrettyString(uid)}");
+                Log.Warning($"Prototype list in ConditionalSpawnComponent is empty! Entity: {ToPrettyString(uid)}");
                 return;
             }
 
@@ -94,7 +94,7 @@ namespace Content.Server.Spawners.EntitySystems
 
             if (component.Prototypes.Count == 0)
             {
-                Logger.Warning($"Prototype list in RandomSpawnerComponent is empty! Entity: {ToPrettyString(uid)}");
+                Log.Warning($"Prototype list in RandomSpawnerComponent is empty! Entity: {ToPrettyString(uid)}");
                 return;
             }
 
index 78d1b1e2125c737ffd25b073fcc91f2be82bac93..4b7cd64961b1d70c3353e9ccccd0fb753fea2901 100644 (file)
@@ -323,8 +323,7 @@ public sealed partial class StationJobsSystem
 
             jobs.ExtendedAccess = count <= thresh;
 
-            Logger.DebugS(
-                "station", "Station {Station} on extended access: {ExtendedAccess}",
+            Log.Debug("Station {Station} on extended access: {ExtendedAccess}",
                 Name(station), jobs.ExtendedAccess);
         }
     }
index 4647392665b52bae4058acf62a122d97959ab418..b9ff8a4339d2b5f78ce6c0679bdecef6eca983ef 100644 (file)
@@ -456,7 +456,7 @@ public sealed class StationSystem : EntitySystem
 
         if (xform.GridUid == EntityUid.Invalid)
         {
-            Log.Debug("A");
+            Log.Debug("Unable to get owning station - GridUid invalid.");
             return null;
         }
 
index b5d1ae79be12114cd3b50c7e1848cb75108e4994..a56d9640d3713c1b61b7e0bc0d59e065ad09f46c 100644 (file)
@@ -43,7 +43,7 @@ public sealed partial class StoreSystem
     {
         if (!_proto.TryIndex<ListingPrototype>(listingId, out var proto))
         {
-            Logger.Error("Attempted to add invalid listing.");
+            Log.Error("Attempted to add invalid listing.");
             return false;
         }
         return TryAddListing(component, proto);
index 50a9cb9b69139fecd0b2c9a5aec775039399c456..96b2ecc00c6043628a464b7bc686c4690e590c60 100644 (file)
@@ -210,7 +210,7 @@ namespace Content.Server.Strip
 
             if (!_inventorySystem.TryGetSlot(target, slot, out var slotDef))
             {
-                Logger.Error($"{ToPrettyString(user)} attempted to place an item in a non-existent inventory slot ({slot}) on {ToPrettyString(target)}");
+                Log.Error($"{ToPrettyString(user)} attempted to place an item in a non-existent inventory slot ({slot}) on {ToPrettyString(target)}");
                 return;
             }
 
@@ -347,7 +347,7 @@ namespace Content.Server.Strip
 
             if (!_inventorySystem.TryGetSlot(target, slot, out var slotDef))
             {
-                Logger.Error($"{ToPrettyString(user)} attempted to take an item from a non-existent inventory slot ({slot}) on {ToPrettyString(target)}");
+                Log.Error($"{ToPrettyString(user)} attempted to take an item from a non-existent inventory slot ({slot}) on {ToPrettyString(target)}");
                 return;
             }
 
index 91b0d6caea878d9d02694a35b46d6f74f538472c..22ee0e4861f4eaa1f0404ee0b0dbd192a7f474e7 100644 (file)
@@ -27,7 +27,7 @@ public sealed class TraitSystem : EntitySystem
         {
             if (!_prototypeManager.TryIndex<TraitPrototype>(traitId, out var traitPrototype))
             {
-                Logger.Warning($"No trait found with ID {traitId}!");
+                Log.Warning($"No trait found with ID {traitId}!");
                 return;
             }
 
index 3fff584217b3b12ca48016ce4f0ee64018634ebe..1827f6deeda7d08b00423fc1d105e8f1cfa6373b 100644 (file)
@@ -1,4 +1,4 @@
-using System.Linq;
+using System.Linq;
 using Content.Server.Worldgen.Components;
 using Content.Server.Worldgen.Prototypes;
 using Robust.Shared.Prototypes;
@@ -35,7 +35,7 @@ public sealed class BiomeSelectionSystem : BaseWorldSystem
             return;
         }
 
-        Logger.Error($"Biome selection ran out of biomes to select? See biomes list: {component.Biomes}");
+        Log.Error($"Biome selection ran out of biomes to select? See biomes list: {component.Biomes}");
     }
 
     private void OnBiomeSelectionStartup(EntityUid uid, BiomeSelectionComponent component, ComponentStartup args)
index d3eeeb6037ad9c8a54eb3351506bf765df1f6228..c47bfb9f8875d2fbe2d42b85650c78b620092608 100644 (file)
@@ -1,4 +1,4 @@
-using Content.Server.Administration;
+using Content.Server.Administration;
 using Content.Server.GameTicking;
 using Content.Server.GameTicking.Events;
 using Content.Server.Worldgen.Components;
@@ -74,7 +74,7 @@ public sealed class WorldgenConfigSystem : EntitySystem
             return;
 
         var target = _map.GetMapEntityId(_gameTicker.DefaultMap);
-        Logger.Debug($"Trying to configure {_gameTicker.DefaultMap}, aka {ToPrettyString(target)} aka {target}");
+        Log.Debug($"Trying to configure {_gameTicker.DefaultMap}, aka {ToPrettyString(target)} aka {target}");
         var cfg = _proto.Index<WorldgenConfigPrototype>(_worldgenConfig);
 
         cfg.Apply(target, _ser, EntityManager); // Apply the config to the map.
index 382ecb5a9a52c6e8b9b33cd6f80933ebaf172b00..9e81c91550f6edddb90081d2e0b3d9343dd01d9e 100644 (file)
@@ -157,7 +157,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
 
         if (doAfter.Delay <= TimeSpan.Zero)
         {
-            Logger.Warning("Awaited instant DoAfters are not supported fully supported");
+            Log.Warning("Awaited instant DoAfters are not supported fully supported");
             return DoAfterStatus.Finished;
         }
 
index 75063c55503fcd51fddbd2171cffad0c6336dd1f..7d5e390b6f01ef625a7150ac9ac3cb4fd6fc6302 100644 (file)
@@ -171,7 +171,7 @@ namespace Content.Shared.Interaction
         {
             if (!ValidateClientInput(session, coords, uid, out var userEntity))
             {
-                Logger.InfoS("system.interaction", $"TryPullObject input validation failed");
+                Log.Info($"TryPullObject input validation failed");
                 return true;
             }
 
@@ -203,7 +203,7 @@ namespace Content.Shared.Interaction
             // client sanitization
             if (!TryComp(item, out TransformComponent? itemXform) || !ValidateClientInput(args.SenderSession, itemXform.Coordinates, item, out var user))
             {
-                Logger.InfoS("system.interaction", $"Inventory interaction validation failed.  Session={args.SenderSession}");
+                Log.Info($"Inventory interaction validation failed.  Session={args.SenderSession}");
                 return;
             }
 
@@ -225,7 +225,7 @@ namespace Content.Shared.Interaction
             // client sanitization
             if (!ValidateClientInput(session, coords, uid, out var user))
             {
-                Logger.InfoS("system.interaction", $"Alt-use input validation failed");
+                Log.Info($"Alt-use input validation failed");
                 return true;
             }
 
@@ -239,7 +239,7 @@ namespace Content.Shared.Interaction
             // client sanitization
             if (!ValidateClientInput(session, coords, uid, out var userEntity))
             {
-                Logger.InfoS("system.interaction", $"Use input validation failed");
+                Log.Info($"Use input validation failed");
                 return true;
             }
 
@@ -547,7 +547,7 @@ namespace Content.Shared.Interaction
 
             if (length > MaxRaycastRange)
             {
-                Logger.Warning("InRangeUnobstructed check performed over extreme range. Limiting CollisionRay size.");
+                Log.Warning("InRangeUnobstructed check performed over extreme range. Limiting CollisionRay size.");
                 length = MaxRaycastRange;
             }
 
@@ -921,7 +921,7 @@ namespace Content.Shared.Interaction
         {
             if (!ValidateClientInput(session, coords, uid, out var user))
             {
-                Logger.InfoS("system.interaction", $"ActivateItemInWorld input validation failed");
+                Log.Info($"ActivateItemInWorld input validation failed");
                 return false;
             }
 
@@ -1100,14 +1100,13 @@ namespace Content.Shared.Interaction
 
             if (!coords.IsValid(EntityManager))
             {
-                Logger.InfoS("system.interaction", $"Invalid Coordinates: client={session}, coords={coords}");
+                Log.Info($"Invalid Coordinates: client={session}, coords={coords}");
                 return false;
             }
 
             if (IsClientSide(uid))
             {
-                Logger.WarningS("system.interaction",
-                    $"Client sent interaction with client-side entity. Session={session}, Uid={uid}");
+                Log.Warning($"Client sent interaction with client-side entity. Session={session}, Uid={uid}");
                 return false;
             }
 
@@ -1115,15 +1114,13 @@ namespace Content.Shared.Interaction
 
             if (userEntity == null || !userEntity.Value.Valid)
             {
-                Logger.WarningS("system.interaction",
-                    $"Client sent interaction with no attached entity. Session={session}");
+                Log.Warning($"Client sent interaction with no attached entity. Session={session}");
                 return false;
             }
 
             if (!Exists(userEntity))
             {
-                Logger.WarningS("system.interaction",
-                    $"Client attempted interaction with a non-existent attached entity. Session={session},  entity={userEntity}");
+                Log.Warning($"Client attempted interaction with a non-existent attached entity. Session={session},  entity={userEntity}");
                 return false;
             }