From a9f7cfbcb6c54fb2483d41b5881a0b97b1ac97da Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Wed, 28 May 2025 12:50:31 -0400 Subject: [PATCH] Update UIControllers to use `Log` (#37792) Update UIControllers to use Log --- Content.Client/ContextMenu/UI/ContextMenuUIController.cs | 4 ++-- Content.Client/ContextMenu/UI/EntityMenuUIController.cs | 2 +- Content.Client/Lobby/LobbyUIController.cs | 3 +-- .../UserInterface/Systems/Actions/ActionUIController.cs | 2 +- .../UserInterface/Systems/Bwoink/AHelpUIController.cs | 4 +++- .../Systems/Character/CharacterUIController.cs | 7 +------ .../Systems/Guidebook/GuidebookUIController.cs | 4 ++-- .../UserInterface/Systems/Info/InfoUIController.cs | 7 +++---- .../Systems/Inventory/InventoryUIController.cs | 2 +- .../UserInterface/Systems/Viewport/ViewportUIController.cs | 2 +- 10 files changed, 16 insertions(+), 21 deletions(-) diff --git a/Content.Client/ContextMenu/UI/ContextMenuUIController.cs b/Content.Client/ContextMenu/UI/ContextMenuUIController.cs index 2d94034bb9..1b83f5ed03 100644 --- a/Content.Client/ContextMenu/UI/ContextMenuUIController.cs +++ b/Content.Client/ContextMenu/UI/ContextMenuUIController.cs @@ -131,7 +131,7 @@ namespace Content.Client.ContextMenu.UI { if (!Menus.TryPeek(out var topMenu)) { - Logger.Error("Context Menu: Mouse entered menu without any open menus?"); + Log.Error("Context Menu: Mouse entered menu without any open menus?"); return; } @@ -181,7 +181,7 @@ namespace Content.Client.ContextMenu.UI { if (!Menus.TryPeek(out var topMenu)) { - Logger.Error("Context Menu: Attempting to open sub menu without any open menus?"); + Log.Error("Context Menu: Attempting to open sub menu without any open menus?"); return; } diff --git a/Content.Client/ContextMenu/UI/EntityMenuUIController.cs b/Content.Client/ContextMenu/UI/EntityMenuUIController.cs index bda831394d..e0a88300db 100644 --- a/Content.Client/ContextMenu/UI/EntityMenuUIController.cs +++ b/Content.Client/ContextMenu/UI/EntityMenuUIController.cs @@ -306,7 +306,7 @@ namespace Content.Client.ContextMenu.UI // find the element associated with this entity if (!Elements.TryGetValue(entity, out var element)) { - Logger.Error($"Attempted to remove unknown entity from the entity menu: {_entityManager.GetComponent(entity).EntityName} ({entity})"); + Log.Error($"Attempted to remove unknown entity from the entity menu: {_entityManager.GetComponent(entity).EntityName} ({entity})"); return; } diff --git a/Content.Client/Lobby/LobbyUIController.cs b/Content.Client/Lobby/LobbyUIController.cs index cea8248e9f..121e8dbe71 100644 --- a/Content.Client/Lobby/LobbyUIController.cs +++ b/Content.Client/Lobby/LobbyUIController.cs @@ -32,7 +32,6 @@ public sealed class LobbyUIController : UIController, IOnStateEntered "c.s.go.es.bwoink"; + public override void Initialize() { base.Initialize(); @@ -129,7 +131,7 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged, IOnStateExited, IOnSystemChanged { [Dependency] private readonly IEntityManager _ent = default!; - [Dependency] private readonly ILogManager _logMan = default!; [Dependency] private readonly IPlayerManager _player = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [UISystemDependency] private readonly CharacterInfoSystem _characterInfo = default!; [UISystemDependency] private readonly SpriteSystem _sprite = default!; - private ISawmill _sawmill = default!; - public override void Initialize() { base.Initialize(); - _sawmill = _logMan.GetSawmill("character"); - SubscribeNetworkEvent(OnRoleTypeChanged); } @@ -222,7 +217,7 @@ public sealed class CharacterUIController : UIController, IOnStateEntered] private const string DefaultRuleset = "DefaultRuleset"; public ProtoId RulesEntryId = DefaultRuleset; + protected override string SawmillName => "rules"; + public override void Initialize() { base.Initialize(); - _sawmill = _logMan.GetSawmill("rules"); _netManager.RegisterNetMessage(); _netManager.RegisterNetMessage(OnRulesInformationMessage); @@ -94,7 +93,7 @@ public sealed class InfoUIController : UIController, IOnStateExited(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; } diff --git a/Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs b/Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs index 1b872484ae..e66ce2ae6c 100644 --- a/Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs +++ b/Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs @@ -243,7 +243,7 @@ public sealed class InventoryUIController : UIController, IOnStateEntered