diff --git a/Content.Server/Administration/Logs/AdminLogSystem.cs b/Content.Server/Administration/Logs/AdminLogSystem.cs index ab78a3a9f1..e763b9ab83 100644 --- a/Content.Server/Administration/Logs/AdminLogSystem.cs +++ b/Content.Server/Administration/Logs/AdminLogSystem.cs @@ -64,6 +64,7 @@ public partial class AdminLogSystem : SharedAdminLogSystem // CVars private bool _metricsEnabled; + private bool _enabled; private TimeSpan _queueSendDelay; private int _queueMax; private int _preRoundQueueMax; @@ -85,6 +86,8 @@ public partial class AdminLogSystem : SharedAdminLogSystem _configuration.OnValueChanged(CVars.MetricsEnabled, value => _metricsEnabled = value, true); + _configuration.OnValueChanged(CCVars.AdminLogsEnabled, + value => _enabled = value, true); _configuration.OnValueChanged(CCVars.AdminLogsQueueSendDelay, value => _queueSendDelay = TimeSpan.FromSeconds(value), true); _configuration.OnValueChanged(CCVars.AdminLogsQueueMax, @@ -268,6 +271,12 @@ public partial class AdminLogSystem : SharedAdminLogSystem public override void Add(LogType type, LogImpact impact, ref LogStringHandler handler) { + if (!_enabled) + { + handler.ToStringAndClear(); + return; + } + var (json, players, entities) = ToJson(handler.Values); var message = handler.ToStringAndClear(); diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index f18d88ed82..6fa605ceb9 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -298,6 +298,9 @@ namespace Content.Shared.CCVar * Admin logs */ + public static readonly CVarDef AdminLogsEnabled = + CVarDef.Create("adminlogs.enabled", true, CVar.SERVERONLY); + public static readonly CVarDef AdminLogsQueueSendDelay = CVarDef.Create("adminlogs.queue_send_delay_seconds", 5f, CVar.SERVERONLY);