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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user