fix: refine editor console logging
This commit is contained in:
@@ -1,20 +1,34 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace XCEngine
|
||||
{
|
||||
public static class Debug
|
||||
{
|
||||
public static void Log(string message)
|
||||
public static void Log(
|
||||
string message,
|
||||
[CallerFilePath] string file = "",
|
||||
[CallerLineNumber] int line = 0,
|
||||
[CallerMemberName] string member = "")
|
||||
{
|
||||
InternalCalls.Debug_Log(message ?? string.Empty);
|
||||
InternalCalls.Debug_Log(message ?? string.Empty, file ?? string.Empty, line, member ?? string.Empty);
|
||||
}
|
||||
|
||||
public static void LogWarning(string message)
|
||||
public static void LogWarning(
|
||||
string message,
|
||||
[CallerFilePath] string file = "",
|
||||
[CallerLineNumber] int line = 0,
|
||||
[CallerMemberName] string member = "")
|
||||
{
|
||||
InternalCalls.Debug_LogWarning(message ?? string.Empty);
|
||||
InternalCalls.Debug_LogWarning(message ?? string.Empty, file ?? string.Empty, line, member ?? string.Empty);
|
||||
}
|
||||
|
||||
public static void LogError(string message)
|
||||
public static void LogError(
|
||||
string message,
|
||||
[CallerFilePath] string file = "",
|
||||
[CallerLineNumber] int line = 0,
|
||||
[CallerMemberName] string member = "")
|
||||
{
|
||||
InternalCalls.Debug_LogError(message ?? string.Empty);
|
||||
InternalCalls.Debug_LogError(message ?? string.Empty, file ?? string.Empty, line, member ?? string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ namespace XCEngine
|
||||
internal static class InternalCalls
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void Debug_Log(string message);
|
||||
internal static extern void Debug_Log(string message, string file, int line, string member);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void Debug_LogWarning(string message);
|
||||
internal static extern void Debug_LogWarning(string message, string file, int line, string member);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void Debug_LogError(string message);
|
||||
internal static extern void Debug_LogError(string message, string file, int line, string member);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern float Time_GetDeltaTime();
|
||||
|
||||
Reference in New Issue
Block a user