This commit is contained in:
CortexCore
2023-11-15 23:54:54 +08:00
parent ee3ecec6cb
commit 3c837a4a33
356 changed files with 73756 additions and 26493 deletions

View File

@@ -26,9 +26,9 @@ namespace BITKit
public static event Action OnNextLine;
private static Type currentType;
#if UNITY_64
[HideInCallstack]
//[HideInCallstack]
#endif
public static void Log(object x, int debugLevel = 0, ConsoleColor color = ConsoleColor.White)
public static void Log(object x, ConsoleColor color = ConsoleColor.White)
{
OnSetConsoleColor?.Invoke(color);
OnLog?.Invoke(x?.ToString());
@@ -36,16 +36,16 @@ namespace BITKit
#if UNITY_64
[HideInCallstack]
#endif
public static void Log<T>(object x, int debugLevel = 0, ConsoleColor color = ConsoleColor.White)
public static void Log<T>(object x, ConsoleColor color = ConsoleColor.White)
{
if (currentType != typeof(T))
{
OnNextLine?.Invoke();
}
#if NET5_0_OR_GREATER
Log($"[{DateTime.Now}]{typeof(T).Name}:{x}", debugLevel);
Log($"[{DateTime.Now}]{typeof(T).Name}:{x}");
#else
Log($"{typeof(T).Name}:{x}", debugLevel);
Log($"{typeof(T).Name}:{x}");
#endif
currentType = typeof(T);
@@ -60,16 +60,16 @@ namespace BITKit
#if UNITY_64
[HideInCallstack]
#endif
public static void Warning(object x, int debugLevel = 0)
public static void Warning(object x)
{
OnWarning?.Invoke(x.ToString());
}
#if UNITY_64
[HideInCallstack]
#endif
public static void Warning<T>(object x, int debugLevel = 0)
public static void Warning<T>(object x)
{
Warning($"{typeof(T).Name}:{x}", debugLevel);
Warning($"{typeof(T).Name}:{x}");
}
}
}