Obsolete Logger cleanup for EntitySystems (#25941)

* Small obsolete Logger cleanup

* Fixed three EntitySystem logs that weren't doing it right.
This commit is contained in:
LordCarve
2024-03-10 01:15:13 +01:00
committed by GitHub
parent 865765d4ec
commit aafe815122
25 changed files with 41 additions and 45 deletions

View 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.

View 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

View 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)

View 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;
}

View 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;
}

View 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;
}

View 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");
}

View 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);

View 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;
}

View 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;
}

View 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);
}
}

View 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;
}

View 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);

View 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;
}

View 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;
}

View 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)

View 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.