using System; using System.Diagnostics.CodeAnalysis; using Microsoft.Extensions.Logging; namespace Jellyfin.Plugin.MediaCleaner.Helpers; public class LoggingHelper(ILogger logger) { private readonly ILogger _logger = logger ?? throw new ArgumentNullException(nameof(logger)); [SuppressMessage("Microsoft.Performance", "CA2254:TemplateShouldBeConstant", Justification = "Message parameter is intentionally variable for flexible debug logging")] public void LogDebugInformation(string message, params object?[] args) { if (Configuration.DebugMode) { _logger.LogInformation(message, args); } } [SuppressMessage("Microsoft.Performance", "CA2254:TemplateShouldBeConstant", Justification = "Message parameter is intentionally variable for flexible logging")] public void LogInformation(string message, params object?[] args) { _logger.LogInformation(message, args); } private static Configuration Configuration => Plugin.Instance!.Configuration; }