From 81d09559c20d0e467495d1d5bef54375f101228b Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Wed, 18 Jun 2025 12:21:48 -0400 Subject: [PATCH] Cleanup static `Logger` use in `ChatBox` (#38405) Convert static logger to resolved, resolve entman --- .../UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs index 289c9fa164..c389cf4dfb 100644 --- a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs +++ b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs @@ -19,8 +19,11 @@ namespace Content.Client.UserInterface.Systems.Chat.Widgets; [Virtual] public partial class ChatBox : UIWidget { + [Dependency] private readonly IEntityManager _entManager = default!; + [Dependency] private readonly ILogManager _log = default!; + + private readonly ISawmill _sawmill; private readonly ChatUIController _controller; - private readonly IEntityManager _entManager; public bool Main { get; set; } @@ -29,7 +32,7 @@ public partial class ChatBox : UIWidget public ChatBox() { RobustXamlLoader.Load(this); - _entManager = IoCManager.Resolve(); + _sawmill = _log.GetSawmill("chat"); ChatInput.Input.OnTextEntered += OnTextEntered; ChatInput.Input.OnKeyBindDown += OnInputKeyBindDown; @@ -52,7 +55,7 @@ public partial class ChatBox : UIWidget private void OnMessageAdded(ChatMessage msg) { - Logger.DebugS("chat", $"{msg.Channel}: {msg.Message}"); + _sawmill.Debug($"{msg.Channel}: {msg.Message}"); if (!ChatInput.FilterButton.Popup.IsActive(msg.Channel)) { return; -- 2.51.2