mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
Logger Sawmill Cleanup (#2413)
# Description Cleaned up Logger obsolete compiler warnings in non robust code. Should probably be changed to a ISawmill reference in classes to avoid repeated lookups in heavy logging logic. --- # Changelog 🆑 - tweak: Logger to Logger.GetSawmill("name"); --------- Co-authored-by: ilmenwe <no@mail.com> (cherry picked from commit 2e8ffd971716d38dc6d5a520bebdf88b743045a3)
This commit is contained in:
@@ -34,7 +34,7 @@ namespace Content.Client.UserInterface.Controls
|
||||
//this auto registers the button with it's parent container when it's set
|
||||
if (_slotNameSet)
|
||||
{
|
||||
Logger.Warning("Tried to set slotName after init for:" + Name);
|
||||
Logger.GetSawmill("slot.control").Warning("Tried to set slotName after init for:" + Name);
|
||||
return;
|
||||
}
|
||||
_slotNameSet = true;
|
||||
|
||||
@@ -193,7 +193,7 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
|
||||
return TryTargetEntityWorld(args, actionId, entMapTarget, user, comp) || !entMapTarget.InteractOnMiss;
|
||||
|
||||
default:
|
||||
Logger.Error($"Unknown targeting action: {actionId.GetType()}");
|
||||
Logger.GetSawmill("action.ui.control").Error($"Unknown targeting action: {actionId.GetType()}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public sealed partial class AlertsUI : UIWidget
|
||||
{
|
||||
if (!alertKey.AlertType.HasValue)
|
||||
{
|
||||
Logger.WarningS("alert", "found alertkey without alerttype," +
|
||||
Logger.GetSawmill("alert").Warning("found alertkey without alerttype," +
|
||||
" alert keys should never be stored without an alerttype set: {0}", alertKey);
|
||||
continue;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public sealed partial class AlertsUI : UIWidget
|
||||
var alertType = alertKey.AlertType.Value;
|
||||
if (!alertsSystem.TryGet(alertType, out var newAlert))
|
||||
{
|
||||
Logger.ErrorS("alert", "Unrecognized alertType {0}", alertType);
|
||||
Logger.GetSawmill("alert").Error("Unrecognized alertType {0}", alertType);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ public sealed class AHelpUIController : UIController, IOnSystemChanged<BwoinkSys
|
||||
|
||||
private void ReceivedBwoink(object? sender, SharedBwoinkSystem.BwoinkTextMessage message)
|
||||
{
|
||||
Logger.InfoS("c.s.go.es.bwoink", $"@{message.UserId}: {message.Text}");
|
||||
Logger.GetSawmill("c.s.go.es.bwoink").Info($"@{message.UserId}: {message.Text}");
|
||||
var localPlayer = _playerManager.LocalSession;
|
||||
if (localPlayer == null)
|
||||
return;
|
||||
|
||||
@@ -81,7 +81,7 @@ public partial class ChatBox : UIWidget
|
||||
|
||||
private void OnMessageAdded(ChatMessage msg)
|
||||
{
|
||||
Logger.DebugS("chat", $"{msg.Channel}: {msg.Message}");
|
||||
Logger.GetSawmill("chat").Debug($"{msg.Channel}: {msg.Message}");
|
||||
if (!ChatInput.FilterButton.Popup.IsActive(msg.Channel))
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -195,7 +195,7 @@ public sealed class GuidebookUIController : UIController, IOnStateEntered<LobbyS
|
||||
{
|
||||
if (!_prototypeManager.TryIndex(guideId, out var guide))
|
||||
{
|
||||
Logger.Error($"Encountered unknown guide prototype: {guideId}");
|
||||
Logger.GetSawmill("guidebook").Error($"Encountered unknown guide prototype: {guideId}");
|
||||
continue;
|
||||
}
|
||||
guides.Add(guideId, guide);
|
||||
@@ -225,7 +225,7 @@ public sealed class GuidebookUIController : UIController, IOnStateEntered<LobbyS
|
||||
|
||||
if (!_prototypeManager.TryIndex(childId, out var child))
|
||||
{
|
||||
Logger.Error($"Encountered unknown guide prototype: {childId} as a child of {guide.Id}. If the child is not a prototype, it must be directly provided.");
|
||||
Logger.GetSawmill("guide.ui.control").Error($"Encountered unknown guide prototype: {childId} as a child of {guide.Id}. If the child is not a prototype, it must be directly provided.");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Numerics;
|
||||
using System.Numerics;
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
@@ -29,7 +29,7 @@ public sealed class InventoryDisplay : LayoutContainer
|
||||
VerticalExpand = true;
|
||||
InheritChildMeasure = true;
|
||||
if (!_buttons.TryAdd(newButton.SlotName, (newButton, buttonOffset)))
|
||||
Logger.Warning("Tried to add button without a slot!");
|
||||
Logger.GetSawmill("inventory.display").Warning("Tried to add button without a slot!");
|
||||
SetPosition(newButton, buttonOffset * ButtonSize + new Vector2(ButtonSpacing, ButtonSpacing));
|
||||
UpdateSizeData(buttonOffset);
|
||||
return newButton;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
|
||||
@@ -84,7 +84,7 @@ public abstract class ItemSlotUIContainer<T> : GridContainer, IItemslotUIContain
|
||||
{
|
||||
if (newButton.SlotName == "")
|
||||
{
|
||||
Logger.Warning("Could not add button " + newButton.Name + "No slotname");
|
||||
Logger.GetSawmill("itemslot.ui.container").Warning("Could not add button " + newButton.Name + "No slotname");
|
||||
}
|
||||
|
||||
return !Buttons.TryAdd(newButton.SlotName, newButton) ? null : newButton;
|
||||
|
||||
@@ -242,7 +242,7 @@ public sealed class InventoryUIController : UIController, IOnStateEntered<Gamepl
|
||||
{
|
||||
if (_inventoryHotbar == null)
|
||||
{
|
||||
Logger.Warning("Tried to toggle inventory bar when none are assigned");
|
||||
Logger.GetSawmill("inventory.ui.control").Warning("Tried to toggle inventory bar when none are assigned");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,6 +99,6 @@ public sealed class ViewportUIController : UIController
|
||||
|
||||
// Currently, this shouldn't happen. This likely happened because the main eye was set to null. When this
|
||||
// does happen it can create hard to troubleshoot bugs, so lets print some helpful warnings:
|
||||
Logger.Warning($"Main viewport's eye is in nullspace (main eye is null?). Attached entity: {_entMan.ToPrettyString(ent.Value)}. Entity has eye comp: {eye != null}");
|
||||
Logger.GetSawmill("viewport.ui.control").Warning($"Main viewport's eye is in nullspace (main eye is null?). Attached entity: {_entMan.ToPrettyString(ent.Value)}. Entity has eye comp: {eye != null}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user