Innovenergy_trunk/csharp/App/SaliMax/src/Logger.cs

20 lines
714 B
C#
Raw Normal View History

2023-06-13 10:53:17 +00:00
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 = 1024 * 1024; // TODO: move to settings
private const Int32 MaxLogFileCount = 1000; // TODO: move to settings
private const String LogFilePath = "LogDirectory/log.txt"; // TODO: move to settings
private static readonly ILogger _logger = new CustomLogger(LogFilePath, MaxFileSizeBytes, MaxLogFileCount);
public static T Log<T>(this T t) where T : notnull
{
// _logger.LogInformation(t.ToString()); // TODO: check warning
return t;
}
}