From c3f0f4625b976279883a22408f040ff6ba495641 Mon Sep 17 00:00:00 2001
From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Date: Sun, 15 May 2022 12:09:35 +1000
Subject: [PATCH] Don't log chat messages (#8162)
Threshold set to info instead. The actual logging is in the xaml itself for reasons but I didn't want to use a sawmill for it to avoid interfering with hud refactor any more.
---
Content.Client/Chat/Managers/ChatManager.cs | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/Content.Client/Chat/Managers/ChatManager.cs b/Content.Client/Chat/Managers/ChatManager.cs
index f58d0ce363..bbe50573c9 100644
--- a/Content.Client/Chat/Managers/ChatManager.cs
+++ b/Content.Client/Chat/Managers/ChatManager.cs
@@ -32,6 +32,8 @@ namespace Content.Client.Chat.Managers
public SpeechBubble.SpeechType Type;
}
+ private ISawmill _sawmill = default!;
+
///
/// The max amount of chars allowed to fit in a single speech bubble.
///
@@ -130,6 +132,8 @@ namespace Content.Client.Chat.Managers
public void Initialize()
{
+ _sawmill = Logger.GetSawmill("chat");
+ _sawmill.Level = LogLevel.Info;
_netManager.RegisterNetMessage(OnChatMessage);
_speechBubbleRoot = new LayoutContainer();
@@ -346,7 +350,7 @@ namespace Content.Client.Chat.Managers
else if (_adminMgr.HasFlag(AdminFlags.Admin))
_consoleHost.ExecuteCommand($"dsay \"{CommandParsing.Escape(str)}\"");
else
- Logger.WarningS("chat", "Tried to speak on deadchat without being ghost or admin.");
+ _sawmill.Warning("Tried to speak on deadchat without being ghost or admin.");
break;
case ChatSelectChannel.Radio:
@@ -393,7 +397,7 @@ namespace Content.Client.Chat.Managers
if (!storedMessage.Read)
{
- Logger.Debug($"Message filtered: {storedMessage.Channel}: {storedMessage.Message}");
+ _sawmill.Debug($"Message filtered: {storedMessage.Channel}: {storedMessage.Message}");
if (!_unreadMessages.TryGetValue(msg.Channel, out var count))
count = 0;
@@ -434,7 +438,7 @@ namespace Content.Client.Chat.Managers
{
if (!_entityManager.EntityExists(msg.SenderEntity))
{
- Logger.WarningS("chat", "Got local chat message with invalid sender entity: {0}", msg.SenderEntity);
+ _sawmill.Warning("Got local chat message with invalid sender entity: {0}", msg.SenderEntity);
return;
}