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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -32,6 +32,8 @@ namespace Content.Client.Chat.Managers
public SpeechBubble.SpeechType Type;
}
private ISawmill _sawmill = default!;
/// <summary>
/// The max amount of chars allowed to fit in a single speech bubble.
/// </summary>
@ -130,6 +132,8 @@ namespace Content.Client.Chat.Managers
public void Initialize()
{
_sawmill = Logger.GetSawmill("chat");
_sawmill.Level = LogLevel.Info;
_netManager.RegisterNetMessage<MsgChatMessage>(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;
}