Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion NexusKit.Hosting/Logging/PluginLoggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ public PluginLogger(IPluginLogSink sink, string category)

public IDisposable? BeginScope<TState>(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<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
{
Expand Down