using UnityEngine;
namespace Needle.Engine.Utils
{
public static class LogHelpers
{
public static void LogWithoutStacktrace(object message, Object context = null)
{
Debug.LogFormat(LogType.Log, LogOption.NoStacktrace, context, "{0}", message);
}
public static void ErrorWithoutStacktrace(object message, Object context = null)
{
Debug.LogFormat(LogType.Error, LogOption.NoStacktrace, context, "{0}", message);
}
public static void WithoutStacktrace(LogType type, object message, Object context = null)
{
Debug.LogFormat(type, LogOption.NoStacktrace, context, "{0}", message);
}
public static string AsLink(this string str, string href = null)
{
return "" + str + "";
}
public static string AsError(this string str)
{
return "" + str + "";
}
public static string AsSuccess(this string str)
{
return "" + str + "";
}
public static string Highlight(this string str)
{
#if UNITY_EDITOR
var highlightColor = UnityEditor.EditorGUIUtility.isProSkin ? "#a4d501" : "#6d0198";
#else
var highlightColor = "#a4d501";
#endif
return "" + str + "";
}
public static string LowContrast(this string str)
{
if (str.Contains("\n")) str = str.Replace("\n", "\n");
return "" + str + "";
}
#if UNITY_EDITOR_WIN
// public static readonly string NeedlePrefix = "\u2688 ".Highlight();
// public static readonly string NeedlePrefixError = "\u2688 ".AsError();
public static readonly string NeedlePrefix = "\u25CF ".Highlight();
public static readonly string NeedlePrefixError = "\u25CF ".AsError();
#else
public static readonly string NeedlePrefix = "\u25a0 ".Highlight();
public static readonly string NeedlePrefixError = "\u25a0 ".AsError();
#endif
}
}