SharedVRCStuff/AAC/AACCore/Editor/Logger.cs
Lillith Rose 1d7052a258 Bring in AAC!
project ive been working on for a while, just felt confident enough to move it here
2025-12-09 21:40:28 -05:00

68 lines
No EOL
2.8 KiB
C#
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections.Generic;
using gay.lilyy.logger;
using UnityEngine;
namespace gay.lilyy.aaccore {
public class V5AACLogger : BaseLogger
{
private static V5AACLogger _instance;
public static V5AACLogger Instance => _instance ??= new V5AACLogger();
protected override string SystemName => "AACCore";
protected override Dictionary<LogLevel, string> LogColors => new()
{
{ LogLevel.Info, "#87CEEB" }, // Sky Blue
{ LogLevel.Warning, "#FFA500" }, // Orange
{ LogLevel.Error, "#FF6B6B" }, // Red
{ LogLevel.Success, "#90EE90" }, // Light Green
{ LogLevel.Debug, "#DDA0DD" } // Plum
};
protected override Dictionary<LogLevel, string> LogPrefixes => new()
{
{ LogLevel.Info, "" },
{ LogLevel.Warning, "⚠️" },
{ LogLevel.Error, "❌" },
{ LogLevel.Success, "✅" },
{ LogLevel.Debug, "🐛" }
};
// Static convenience methods for easy access
public static void LogInfo(string message, Object context = null) => Instance.Info(message, context);
public static void LogWarning(string message, Object context = null) => Instance.Warning(message, context);
public static void LogError(string message, Object context = null) => Instance.Error(message, context);
public static void LogSuccess(string message, Object context = null) => Instance.Success(message, context);
public static void LogDebug(string message, Object context = null) => Instance.Debug(message, context);
}
public class V5AACLayerGroupLogger : BaseLogger
{
private readonly string _layerName;
public V5AACLayerGroupLogger(string layerName)
{
_layerName = layerName;
}
protected override string SystemName => $"AACCore [{_layerName}] ";
protected override Dictionary<LogLevel, string> LogColors => new()
{
{ LogLevel.Info, "#87CEEB" },
{ LogLevel.Warning, "#FFA500" },
{ LogLevel.Error, "#FF6B6B" },
{ LogLevel.Success, "#90EE90" },
{ LogLevel.Debug, "#DDA0DD" }
};
protected override Dictionary<LogLevel, string> LogPrefixes => new();
// Convenience methods for easy access
public void LogInfo(string message, Object context = null) => Info(message, context);
public void LogWarning(string message, Object context = null) => Warning(message, context);
public void LogError(string message, Object context = null) => Error(message, context);
public void LogSuccess(string message, Object context = null) => Success(message, context);
public void LogDebug(string message, Object context = null) => Debug(message, context);
}
}