Refactored into separated components

This commit is contained in:
2026-09-06 14:32:27 +02:00
parent 6519ec5d97
commit 073d20ff28
12 changed files with 761 additions and 1059 deletions
+40
View File
@@ -0,0 +1,40 @@
using BepInEx.Logging;
namespace AutoRefillFires
{
internal class ModLogger
{
private readonly ModConfig _config;
private readonly ManualLogSource _logger;
public ModLogger(ModConfig config, ManualLogSource logger)
{
_config = config;
_logger = logger;
}
public void Debug(string message)
{
if (_config.LogLevel.Value >= ModLogLevel.Debug)
_logger.LogInfo($"[DEBUG] {message}");
}
public void Info(string message)
{
if (_config.LogLevel.Value >= ModLogLevel.Info)
_logger.LogInfo(message);
}
public void Warning(string message)
{
if (_config.LogLevel.Value >= ModLogLevel.Warning)
_logger.LogWarning(message);
}
public void Error(string message)
{
if (_config.LogLevel.Value >= ModLogLevel.Error)
_logger.LogError(message);
}
}
}