using UnityEditor;
using UnityEngine;
namespace MCPForUnity.Editor.Helpers
{
internal static class McpLog
{
private const string LogPrefix = "MCP-FOR-UNITY:";
private const string WarnPrefix = "MCP-FOR-UNITY:";
private const string ErrorPrefix = "MCP-FOR-UNITY:";
private static bool IsDebugEnabled()
{
try { return EditorPrefs.GetBool("MCPForUnity.DebugLogs", false); } catch { return false; }
}
public static void Info(string message, bool always = true)
{
if (!always && !IsDebugEnabled()) return;
Debug.Log($"{LogPrefix} {message}");
}
public static void Warn(string message)
{
Debug.LogWarning($"{WarnPrefix} {message}");
}
public static void Error(string message)
{
Debug.LogError($"{ErrorPrefix} {message}");
}
}
}