Unify Content's EntitySystem logging (#26216)

Use Log with generated sawmill name rather than explicitly named one for all non rule-based Content EntitySystems.
This commit is contained in:
LordCarve
2024-03-17 21:30:27 +01:00
committed by GitHub
parent 4357b9ef08
commit eeaea6c25b
13 changed files with 43 additions and 82 deletions

View File

@@ -39,15 +39,11 @@ public sealed partial class MechSystem : SharedMechSystem
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
private ISawmill _sawmill = default!;
/// <inheritdoc/>
public override void Initialize()
{
base.Initialize();
_sawmill = Logger.GetSawmill("mech");
SubscribeLocalEvent<MechComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<MechComponent, EntInsertedIntoContainerMessage>(OnInsertBattery);
SubscribeLocalEvent<MechComponent, MapInitEvent>(OnMapInit);
@@ -343,7 +339,7 @@ public sealed partial class MechSystem : SharedMechSystem
_battery.SetCharge(battery!.Value, batteryComp.CurrentCharge + delta.Float(), batteryComp);
if (batteryComp.CurrentCharge != component.Energy) //if there's a discrepency, we have to resync them
{
_sawmill.Debug($"Battery charge was not equal to mech charge. Battery {batteryComp.CurrentCharge}. Mech {component.Energy}");
Log.Debug($"Battery charge was not equal to mech charge. Battery {batteryComp.CurrentCharge}. Mech {component.Energy}");
component.Energy = batteryComp.CurrentCharge;
Dirty(component);
}