From c2106a8f36c157c4e4aeb8d662bcd8a4a8f3d891 Mon Sep 17 00:00:00 2001 From: nxships <2096086+nxships@users.noreply.github.com> Date: Mon, 25 May 2026 14:39:42 +0200 Subject: [PATCH] chore(logging): suppress Trace/Debug/Info in Release builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PluginLogger.IsEnabled now gates everything below Warning behind !DEBUG, so Release builds only forward Warning/Error/Critical to Dalamud's /xllog. Debug builds keep the full firehose. The PluginLogger is the single bridge between Microsoft.Extensions. Logging and IPluginLogSink, so gating IsEnabled is sufficient — no M.E.L filter rules can re-open the gate from the consumer side. --- NexusKit.Hosting/Logging/PluginLoggerProvider.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/NexusKit.Hosting/Logging/PluginLoggerProvider.cs b/NexusKit.Hosting/Logging/PluginLoggerProvider.cs index c346414..a22da94 100644 --- a/NexusKit.Hosting/Logging/PluginLoggerProvider.cs +++ b/NexusKit.Hosting/Logging/PluginLoggerProvider.cs @@ -29,7 +29,15 @@ public PluginLogger(IPluginLogSink sink, string category) public IDisposable? BeginScope(TState state) where TState : notnull => null; - public bool IsEnabled(LogLevel logLevel) => logLevel != LogLevel.None; + public bool IsEnabled(LogLevel logLevel) + { + if (logLevel == LogLevel.None) return false; +#if !DEBUG + // Release-Builds: Trace/Debug/Information aus /xllog raushalten. + if (logLevel < LogLevel.Warning) return false; +#endif + return true; + } public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter) {