Enhance AIImages mod by adding debug logging functionality to various components, improving troubleshooting capabilities. Introduce a new setting to enable or disable debug logs in the UI, with localized strings in English and Russian. Update StableDiffusionNet.Core dependency to version 1.1.5. Update AIImages.dll to reflect these changes.
This commit is contained in:
43
Source/AIImages/Helpers/DebugLogger.cs
Normal file
43
Source/AIImages/Helpers/DebugLogger.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Verse;
|
||||
|
||||
namespace AIImages.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Вспомогательный класс для условного отладочного логирования
|
||||
/// </summary>
|
||||
public static class DebugLogger
|
||||
{
|
||||
/// <summary>
|
||||
/// Логирует сообщение только если включены отладочные логи
|
||||
/// </summary>
|
||||
public static void Log(string message)
|
||||
{
|
||||
if (AIImagesMod.Settings?.enableDebugLogs == true)
|
||||
{
|
||||
Verse.Log.Message(message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Логирует предупреждение только если включены отладочные логи
|
||||
/// </summary>
|
||||
public static void Warning(string message)
|
||||
{
|
||||
if (AIImagesMod.Settings?.enableDebugLogs == true)
|
||||
{
|
||||
Verse.Log.Warning(message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Логирует ошибку только если включены отладочные логи
|
||||
/// </summary>
|
||||
public static void Error(string message)
|
||||
{
|
||||
if (AIImagesMod.Settings?.enableDebugLogs == true)
|
||||
{
|
||||
Verse.Log.Error(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user