Files
jellyfin-plugin-mediacleaner/Jellyfin.Plugin.MediaCleaner/Helpers/LoggingHelper.cs

29 lines
1.0 KiB
C#

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;
}