From 44280f97d883c045a9e3d7bebf90b7ec8195bf69 Mon Sep 17 00:00:00 2001 From: wangbowen36 Date: Wed, 6 Aug 2025 16:16:04 +0800 Subject: [PATCH] ArkNativeEngine::LoadNativeModule Add Maintain Logs Issue: https://gitee.com/openharmony/arkui_napi/issues/ICRCN8 Signed-off-by: wangbowen36 --- native_engine/impl/ark/ark_native_engine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/native_engine/impl/ark/ark_native_engine.cpp b/native_engine/impl/ark/ark_native_engine.cpp index c2b14e05a..58b29d268 100644 --- a/native_engine/impl/ark/ark_native_engine.cpp +++ b/native_engine/impl/ark/ark_native_engine.cpp @@ -824,7 +824,7 @@ Local ArkNativeEngine::LoadNativeModule( char fileName[NAPI_PATH_MAX] = { 0 }; const char* name = module->name; if (sprintf_s(fileName, sizeof(fileName), "lib%s.z.so/%s.js", name, name) == -1) { - HILOG_ERROR("sprintf_s file name failed"); + HILOG_ERROR("sprintf_s file name failed, name:%{public}s", name ? name : "nullptr"); return scope.Escape(exports); } HILOG_DEBUG("load js code from %{public}s", fileName); @@ -837,7 +837,7 @@ Local ArkNativeEngine::LoadNativeModule( auto exportObject = LoadArkModule(buffer, module->jsCodeLen, fileName); if (exportObject->IsUndefined()) { - HILOG_ERROR("load module failed"); + HILOG_ERROR("load module failed, fileName:%{public}s", fileName); return scope.Escape(exports); } else { exports = exportObject; @@ -862,7 +862,7 @@ Local ArkNativeEngine::LoadNativeModule( exports = exportObj; loadedModules_[module] = Global(vm_, exports); } else { - HILOG_ERROR("init module failed"); + HILOG_ERROR("init module failed, moduleName:%{public}s", strModuleName.c_str()); return scope.Escape(exports); } -- Gitee