using Microsoft.Extensions.Logging; namespace InnovEnergy.App.SaliMax; public static class Logger { // Specify the maximum log file size in bytes (e.g., 1 MB) private const Int32 MaxFileSizeBytes = 2024 * 30; // TODO: move to settings private const Int32 MaxLogFileCount = 5000; // TODO: move to settings private const String LogFilePath = "LogDirectory/log.csv"; // TODO: move to settings // ReSharper disable once InconsistentNaming private static readonly ILogger _logger = new CustomLogger(LogFilePath, MaxFileSizeBytes, MaxLogFileCount); public static T LogInfo(this T t) where T : notnull { _logger.LogInformation(t.ToString()); // TODO: check warning return t; } public static T LogDebug(this T t) where T : notnull { _logger.LogDebug(t.ToString()); // TODO: check warning return t; } public static T LogError(this T t) where T : notnull { _logger.LogError(t.ToString()); // TODO: check warning return t; } public static T LogWarning(this T t) where T : notnull { _logger.LogWarning(t.ToString()); // TODO: check warning return t; } }