diff --git a/native/cocos/scripting/js-bindings/manual/ScriptingCore.cpp b/native/cocos/scripting/js-bindings/manual/ScriptingCore.cpp index 2afa4ee167..315a5f48b2 100644 --- a/native/cocos/scripting/js-bindings/manual/ScriptingCore.cpp +++ b/native/cocos/scripting/js-bindings/manual/ScriptingCore.cpp @@ -902,7 +902,7 @@ void ScriptingCore::reportError(JSContext *cx, const char *message, JSErrorRepor __android_log_print(ANDROID_LOG_ERROR, "cocos js error:", "%s line:%u msg:%s", fileName.c_str(), report->lineno, msg.c_str()); #else - printf("%s:%u:%s\n", fileName.c_str(), report->lineno, msg.c_str()); + cocos2d::log("%s:%u:%s\n", fileName.c_str(), report->lineno, msg.c_str()); #endif // Should clear pending exception, otherwise it will trigger infinite loop if (JS_IsExceptionPending(cx)) {