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

@@ -18,14 +18,10 @@ public sealed class ThirstSystem : EntitySystem
[Dependency] private readonly MovementSpeedModifierSystem _movement = default!;
[Dependency] private readonly SharedJetpackSystem _jetpack = default!;
private ISawmill _sawmill = default!;
public override void Initialize()
{
base.Initialize();
_sawmill = Logger.GetSawmill("thirst");
SubscribeLocalEvent<ThirstComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovespeed);
SubscribeLocalEvent<ThirstComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<ThirstComponent, RejuvenateEvent>(OnRejuvenate);
@@ -156,7 +152,7 @@ public sealed class ThirstSystem : EntitySystem
return;
default:
_sawmill.Error($"No thirst threshold found for {component.CurrentThirstThreshold}");
Log.Error($"No thirst threshold found for {component.CurrentThirstThreshold}");
throw new ArgumentOutOfRangeException($"No thirst threshold found for {component.CurrentThirstThreshold}");
}
}