Update UIControllers to use Log (#37792)

Update UIControllers to use Log
This commit is contained in:
Tayrtahn
2025-05-28 12:50:31 -04:00
committed by GitHub
parent 721d224fd7
commit a9f7cfbcb6
10 changed files with 16 additions and 21 deletions

View File

@@ -15,22 +15,21 @@ public sealed class InfoUIController : UIController, IOnStateExited<GameplayStat
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
[Dependency] private readonly INetManager _netManager = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly ILogManager _logMan = default!;
private RulesPopup? _rulesPopup;
private RulesAndInfoWindow? _infoWindow;
private ISawmill _sawmill = default!;
[ValidatePrototypeId<GuideEntryPrototype>]
private const string DefaultRuleset = "DefaultRuleset";
public ProtoId<GuideEntryPrototype> RulesEntryId = DefaultRuleset;
protected override string SawmillName => "rules";
public override void Initialize()
{
base.Initialize();
_sawmill = _logMan.GetSawmill("rules");
_netManager.RegisterNetMessage<RulesAcceptedMessage>();
_netManager.RegisterNetMessage<SendRulesInformationMessage>(OnRulesInformationMessage);
@@ -94,7 +93,7 @@ public sealed class InfoUIController : UIController, IOnStateExited<GameplayStat
if (!_prototype.TryIndex(RulesEntryId, out var guideEntryPrototype))
{
guideEntryPrototype = _prototype.Index<GuideEntryPrototype>(DefaultRuleset);
_sawmill.Error($"Couldn't find the following prototype: {RulesEntryId}. Falling back to {DefaultRuleset}, please check that the server has the rules set up correctly");
Log.Error($"Couldn't find the following prototype: {RulesEntryId}. Falling back to {DefaultRuleset}, please check that the server has the rules set up correctly");
return guideEntryPrototype;
}