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

@@ -17,8 +17,11 @@ public sealed class RoleBanCommand : IConsoleCommand
[Dependency] private readonly IPlayerLocator _locator = default!;
[Dependency] private readonly IBanManager _bans = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly ILogManager _log = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
private ISawmill? _sawmill;
public string Command => "roleban";
public string Description => Loc.GetString("cmd-roleban-desc");
public string Help => Loc.GetString("cmd-roleban-help");
@@ -31,7 +34,8 @@ public sealed class RoleBanCommand : IConsoleCommand
uint minutes;
if (!Enum.TryParse(_cfg.GetCVar(CCVars.RoleBanDefaultSeverity), out NoteSeverity severity))
{
Logger.WarningS("admin.role_ban", "Role ban severity could not be parsed from config! Defaulting to medium.");
_sawmill ??= _log.GetSawmill("admin.role_ban");
_sawmill.Warning("Role ban severity could not be parsed from config! Defaulting to medium.");
severity = NoteSeverity.Medium;
}
@@ -81,7 +85,7 @@ public sealed class RoleBanCommand : IConsoleCommand
if (!_proto.HasIndex<JobPrototype>(job))
{
shell.WriteError(Loc.GetString("cmd-roleban-job-parse",("job", job)));
shell.WriteError(Loc.GetString("cmd-roleban-job-parse", ("job", job)));
return;
}