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.
This commit is contained in:
metalgearsloth
2022-05-15 12:09:35 +10:00
committed by GitHub
parent c798c99532
commit c3f0f4625b

View File

@@ -32,6 +32,8 @@ namespace Content.Client.Chat.Managers
public SpeechBubble.SpeechType Type; public SpeechBubble.SpeechType Type;
} }
private ISawmill _sawmill = default!;
/// <summary> /// <summary>
/// The max amount of chars allowed to fit in a single speech bubble. /// The max amount of chars allowed to fit in a single speech bubble.
/// </summary> /// </summary>
@@ -130,6 +132,8 @@ namespace Content.Client.Chat.Managers
public void Initialize() public void Initialize()
{ {
_sawmill = Logger.GetSawmill("chat");
_sawmill.Level = LogLevel.Info;
_netManager.RegisterNetMessage<MsgChatMessage>(OnChatMessage); _netManager.RegisterNetMessage<MsgChatMessage>(OnChatMessage);
_speechBubbleRoot = new LayoutContainer(); _speechBubbleRoot = new LayoutContainer();
@@ -346,7 +350,7 @@ namespace Content.Client.Chat.Managers
else if (_adminMgr.HasFlag(AdminFlags.Admin)) else if (_adminMgr.HasFlag(AdminFlags.Admin))
_consoleHost.ExecuteCommand($"dsay \"{CommandParsing.Escape(str)}\""); _consoleHost.ExecuteCommand($"dsay \"{CommandParsing.Escape(str)}\"");
else 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; break;
case ChatSelectChannel.Radio: case ChatSelectChannel.Radio:
@@ -393,7 +397,7 @@ namespace Content.Client.Chat.Managers
if (!storedMessage.Read) 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)) if (!_unreadMessages.TryGetValue(msg.Channel, out var count))
count = 0; count = 0;
@@ -434,7 +438,7 @@ namespace Content.Client.Chat.Managers
{ {
if (!_entityManager.EntityExists(msg.SenderEntity)) 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; return;
} }