Cleanup some easy-to-fix static logger warnings (#37820)

This commit is contained in:
Tayrtahn
2025-05-25 17:20:08 -04:00
committed by GitHub
parent 1f2d4e7efc
commit 3c48e6abaa
5 changed files with 23 additions and 8 deletions

View File

@@ -13,16 +13,19 @@ public sealed class UserNotesEui : BaseEui
{
[Dependency] private readonly IAdminNotesManager _notesMan = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly ILogManager _log = default!;
private readonly bool _seeOwnNotes;
private readonly ISawmill _sawmill;
public UserNotesEui()
{
IoCManager.InjectDependencies(this);
_sawmill = _log.GetSawmill("admin.notes");
_seeOwnNotes = _cfg.GetCVar(CCVars.SeeOwnNotes);
if (!_seeOwnNotes)
{
Logger.WarningS("admin.notes", "User notes initialized when see_own_notes set to false");
_sawmill.Warning("User notes initialized when see_own_notes set to false");
}
}
@@ -39,7 +42,7 @@ public sealed class UserNotesEui : BaseEui
{
if (!_seeOwnNotes)
{
Logger.WarningS("admin.notes", $"User {Player.Name} with ID {Player.UserId} tried to update their own user notes when see_own_notes was set to false");
_sawmill.Warning($"User {Player.Name} with ID {Player.UserId} tried to update their own user notes when see_own_notes was set to false");
return;
}