fix: refine editor console logging

This commit is contained in:
2026-04-05 02:26:21 +08:00
parent cb7d60ec13
commit 811958351e
4 changed files with 123 additions and 68 deletions

View File

@@ -458,22 +458,34 @@ MonoArray* CreateManagedComponentArray(MonoClass* componentClass, const std::vec
return array;
}
void InternalCall_Debug_Log(MonoString* message) {
XCEngine::Debug::Logger::Get().Info(
void LogManagedMessage(
XCEngine::Debug::LogLevel level,
MonoString* message,
MonoString* file,
int32_t line,
MonoString* member) {
const std::string messageText = MonoStringToUtf8(message);
const std::string fileText = MonoStringToUtf8(file);
const std::string memberText = MonoStringToUtf8(member);
XCEngine::Debug::Logger::Get().Log(
level,
XCEngine::Debug::LogCategory::Scripting,
XCEngine::Containers::String(MonoStringToUtf8(message).c_str()));
XCEngine::Containers::String(messageText.c_str()),
fileText.c_str(),
line,
memberText.c_str());
}
void InternalCall_Debug_LogWarning(MonoString* message) {
XCEngine::Debug::Logger::Get().Warning(
XCEngine::Debug::LogCategory::Scripting,
XCEngine::Containers::String(MonoStringToUtf8(message).c_str()));
void InternalCall_Debug_Log(MonoString* message, MonoString* file, int32_t line, MonoString* member) {
LogManagedMessage(XCEngine::Debug::LogLevel::Info, message, file, line, member);
}
void InternalCall_Debug_LogError(MonoString* message) {
XCEngine::Debug::Logger::Get().Error(
XCEngine::Debug::LogCategory::Scripting,
XCEngine::Containers::String(MonoStringToUtf8(message).c_str()));
void InternalCall_Debug_LogWarning(MonoString* message, MonoString* file, int32_t line, MonoString* member) {
LogManagedMessage(XCEngine::Debug::LogLevel::Warning, message, file, line, member);
}
void InternalCall_Debug_LogError(MonoString* message, MonoString* file, int32_t line, MonoString* member) {
LogManagedMessage(XCEngine::Debug::LogLevel::Error, message, file, line, member);
}
float InternalCall_Time_GetDeltaTime() {