using System;
namespace DA_Assets.Logging
{
public static class DALogger
{
public static string violetColor = "#8b00ff";
public static void LogException(Exception ex)
{
UnityEngine.Debug.LogException(ex);
}
public static void LogError(string log)
{
log = SubstringSafe(log, 15000);
UnityEngine.Debug.LogError(log);
}
public static void LogWarning(string log)
{
log = SubstringSafe(log, 15000);
UnityEngine.Debug.LogWarning(log);
}
public static void Log(string log)
{
log = SubstringSafe(log, 15000);
UnityEngine.Debug.Log(log.TextBold());
}
public static void LogSuccess(string log)
{
UnityEngine.Debug.Log(log.TextColor(violetColor).TextBold());
}
public static string SubstringSafe(string value, int maxLength)
{
return value?.Length > maxLength ? value.Substring(0, maxLength) : value;
}
}
internal static class RichTextExtensions
{
///
///
///
public static string TextBold(this string str) => "" + str + "";
public static string TextColor(this string str, string clr) => string.Format("{1}", clr, str);
public static string TextItalic(this string str) => "" + str + "";
public static string TextSize(this string str, int size) => string.Format("{1}", size, str);
}
}