diff --git a/native/cocos/editor-support/spine-wasm/spine-wasm.cpp b/native/cocos/editor-support/spine-wasm/spine-wasm.cpp index 204731fde91..1f8a4eeeac4 100644 --- a/native/cocos/editor-support/spine-wasm/spine-wasm.cpp +++ b/native/cocos/editor-support/spine-wasm/spine-wasm.cpp @@ -4,10 +4,19 @@ #include "util-function.h" #include "wasmSpineExtension.h" +#include +#include + #include "spine/HashMap.h" using namespace spine; +static void logToConsole(const char* message) { + EM_ASM({ + console.log(UTF8ToString($0)); + }, message); +} + namespace { HashMap skeletonDataMap{}; @@ -39,9 +48,9 @@ namespace { attachmentVertices->_textureId = textureMap[textureName]; } else { spine::String logInfo(attachment->getName()); - logInfo.append(" attachment's texture does not exist "); + logInfo.append(" attachment's texture is not exist "); logInfo.append(textureName); - printf("%s\n", logInfo.buffer()); + logToConsole(logInfo.buffer()); } } }