This commit is contained in:
CortexCore
2023-11-15 23:55:06 +08:00
parent 5446067f91
commit 70247f0242
82 changed files with 3271 additions and 579 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}");
}
}
}