From d91d50fec2fc4ccf03c9b8a8799f89ef0660984b Mon Sep 17 00:00:00 2001 From: fan-jingle Date: Mon, 4 Aug 2025 16:29:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fan-jingle --- modules/asan/asan_detector.c | 2 +- modules/common/appspawn_silk.c | 13 ++----- modules/sandbox/normal/sandbox_common.cpp | 4 +- .../sandbox/normal/sandbox_shared_mount.cpp | 38 +++++++++---------- util/include/appspawn_utils.h | 24 ++++++++++++ util/include/json_utils.h | 2 +- 6 files changed, 51 insertions(+), 32 deletions(-) diff --git a/modules/asan/asan_detector.c b/modules/asan/asan_detector.c index 3bbecf98..bdeb7cb9 100644 --- a/modules/asan/asan_detector.c +++ b/modules/asan/asan_detector.c @@ -125,7 +125,7 @@ static int CheckSupportColdStart(const char *bundleName) APPSPAWN_CHECK(len > 0 && (len < WRAP_VALUE_MAX_LENGTH), return -1, "Invalid to format wrapBundleNameKey"); int ret = GetParameter(wrapBundleNameKey, "", wrapBundleNameValue, WRAP_VALUE_MAX_LENGTH); - APPSPAWN_CHECK(ret > 0 && (!strcmp(wrapBundleNameValue, "asan_wrapper")), return -1, + APPSPAWN_CHECK_LOGV(ret > 0 && (!strcmp(wrapBundleNameValue, "asan_wrapper")), return -1, "Not wrap %{public}s.", bundleName); APPSPAWN_LOGI("Asan: GetParameter %{public}s the value is %{public}s.", wrapBundleNameKey, wrapBundleNameValue); return 0; diff --git a/modules/common/appspawn_silk.c b/modules/common/appspawn_silk.c index ee349404..2f8d9141 100644 --- a/modules/common/appspawn_silk.c +++ b/modules/common/appspawn_silk.c @@ -118,15 +118,10 @@ void LoadSilkConfig(void) bool LoadSilkLibrary(const char *packageName) { bool isSuccess = false; - if (g_silkConfig.configItems == NULL) { - APPSPAWN_LOGV("ConfigItems is NULL"); - return isSuccess; - } - if (packageName == NULL) { - APPSPAWN_LOGV("PackageName is NULL"); - FreeAllSilkConfig(); - return isSuccess; - } + APPSPAWN_CHECK_LOGV(g_silkConfig.configItems != NULL, return isSuccess, + "ConfigItems is NULL"); + APPSPAWN_CHECK_LOGV(packageName != NULL, FreeAllSilkConfig(); return isSuccess, + "PackageName is NULL"); char **appName = NULL; void *handle = NULL; for (int i = 0; i < g_silkConfig.configCursor; i++) { diff --git a/modules/sandbox/normal/sandbox_common.cpp b/modules/sandbox/normal/sandbox_common.cpp index 5552befe..55f66802 100644 --- a/modules/sandbox/normal/sandbox_common.cpp +++ b/modules/sandbox/normal/sandbox_common.cpp @@ -304,7 +304,7 @@ bool SandboxCommon::VerifyDirRecursive(const std::string &path) index = pathIndex == std::string::npos ? size : pathIndex + 1; std::string dir = path.substr(0, index); #ifndef APPSPAWN_TEST - APPSPAWN_CHECK(access(dir.c_str(), F_OK) == 0, + APPSPAWN_CHECK_LOGW(access(dir.c_str(), F_OK) == 0, return false, "check dir %{public}s failed, strerror: %{public}s", dir.c_str(), strerror(errno)); #endif } while (index < size); @@ -989,7 +989,7 @@ int32_t SandboxCommon::DoAppSandboxMountOnce(const AppSpawningCtx *appProperty, struct timespec mountEnd = {0}; clock_gettime(CLOCK_MONOTONIC_COARSE, &mountEnd); uint64_t diff = DiffTime(&mountStart, &mountEnd); - APPSPAWN_CHECK_ONLY_LOG(diff < SandboxCommonDef::MAX_MOUNT_TIME, "mount %{public}s time %{public}" PRId64 " us", + APPSPAWN_CHECK_ONLY_LOGW(diff < SandboxCommonDef::MAX_MOUNT_TIME, "mount %{public}s time %{public}" PRId64 " us", arg->srcPath, diff); #ifdef APPSPAWN_HISYSEVENT APPSPAWN_CHECK_ONLY_EXPER(diff < FUNC_REPORT_DURATION, ReportAbnormalDuration(arg->srcPath, diff)); diff --git a/modules/sandbox/normal/sandbox_shared_mount.cpp b/modules/sandbox/normal/sandbox_shared_mount.cpp index 63a02377..0f2c164f 100644 --- a/modules/sandbox/normal/sandbox_shared_mount.cpp +++ b/modules/sandbox/normal/sandbox_shared_mount.cpp @@ -174,7 +174,7 @@ static int MountEl1Bundle(const AppSpawningCtx *property, const AppDacInfo *info int ret = snprintf_s(sourcePath, PATH_MAX_LEN, PATH_MAX_LEN - 1, "/data/app/el1/bundle/public/%s", bundleInfo->bundleName); if (ret <= 0) { - APPSPAWN_LOGE("snprintf data/app/el1/bundle/public/%{public}s failed, errno %{public}d", + APPSPAWN_LOGW("snprintf data/app/el1/bundle/public/%{public}s failed, errno %{public}d", bundleInfo->bundleName, errno); return APPSPAWN_ERROR_UTILS_MEM_FAIL; } @@ -190,13 +190,13 @@ static int MountEl1Bundle(const AppSpawningCtx *property, const AppDacInfo *info ret = MakeDirRec(targetPath, DIR_MODE, 1); if (ret != 0) { - APPSPAWN_LOGE("mkdir %{public}s failed, errno %{public}d", targetPath, errno); + APPSPAWN_LOGW("mkdir %{public}s failed, errno %{public}d", targetPath, errno); return APPSPAWN_SANDBOX_ERROR_MKDIR_FAIL; } ret = umount2(targetPath, MNT_DETACH); if (ret != 0) { - APPSPAWN_LOGE("umount2 %{public}s failed, errno %{public}d", targetPath, errno); + APPSPAWN_LOGW("umount2 %{public}s failed, errno %{public}d", targetPath, errno); } SharedMountArgs arg = { @@ -209,7 +209,7 @@ static int MountEl1Bundle(const AppSpawningCtx *property, const AppDacInfo *info }; ret = DoSharedMount(&arg); if (ret != 0) { - APPSPAWN_LOGE("mount %{public}s shared failed, ret %{public}d", targetPath, ret); + APPSPAWN_LOGW("mount %{public}s shared failed, ret %{public}d", targetPath, ret); } std::string key = std::to_string(info->uid / UID_BASE) + "-" + std::string(varBundleName); g_mountInfoMap[key]++; @@ -223,7 +223,7 @@ static int MountWithFileMgr(const AppSpawningCtx *property, const AppDacInfo *in int ret = snprintf_s(nosharefsDocsDir, PATH_MAX_LEN, PATH_MAX_LEN - 1, "/mnt/user/%u/nosharefs/docs", info->uid / UID_BASE); if (ret <= 0) { - APPSPAWN_LOGE("snprintf nosharefsDocsDir failed, errno %{public}d", errno); + APPSPAWN_LOGW("snprintf nosharefsDocsDir failed, errno %{public}d", errno); return APPSPAWN_ERROR_UTILS_MEM_FAIL; } @@ -232,7 +232,7 @@ static int MountWithFileMgr(const AppSpawningCtx *property, const AppDacInfo *in ret = snprintf_s(storageUserPath, PATH_MAX_LEN, PATH_MAX_LEN - 1, "/mnt/sandbox/%u/%s/storage/Users", info->uid / UID_BASE, varBundleName); if (ret <= 0) { - APPSPAWN_LOGE("snprintf storageUserPath failed, errno %{public}d", errno); + APPSPAWN_LOGW("snprintf storageUserPath failed, errno %{public}d", errno); return APPSPAWN_ERROR_UTILS_MEM_FAIL; } @@ -244,7 +244,7 @@ static int MountWithFileMgr(const AppSpawningCtx *property, const AppDacInfo *in ret = MakeDirRec(storageUserPath, DIR_MODE, 1); if (ret != 0) { - APPSPAWN_LOGE("mkdir %{public}s failed, errno %{public}d", storageUserPath, errno); + APPSPAWN_LOGW("mkdir %{public}s failed, errno %{public}d", storageUserPath, errno); return APPSPAWN_SANDBOX_ERROR_MKDIR_FAIL; } @@ -258,7 +258,7 @@ static int MountWithFileMgr(const AppSpawningCtx *property, const AppDacInfo *in }; ret = DoSharedMount(&arg); if (ret != 0) { - APPSPAWN_LOGE("mount %{public}s shared failed, ret %{public}d", storageUserPath, ret); + APPSPAWN_LOGW("mount %{public}s shared failed, ret %{public}d", storageUserPath, ret); } return ret; } @@ -270,7 +270,7 @@ static int MountWithOther(const AppSpawningCtx *property, const AppDacInfo *info int ret = snprintf_s(sharefsDocsDir, PATH_MAX_LEN, PATH_MAX_LEN - 1, "/mnt/user/%u/sharefs/docs", info->uid / UID_BASE); if (ret <= 0) { - APPSPAWN_LOGE("snprintf sharefsDocsDir failed, errno %{public}d", errno); + APPSPAWN_LOGW("snprintf sharefsDocsDir failed, errno %{public}d", errno); return APPSPAWN_ERROR_UTILS_MEM_FAIL; } @@ -279,7 +279,7 @@ static int MountWithOther(const AppSpawningCtx *property, const AppDacInfo *info ret = snprintf_s(storageUserPath, PATH_MAX_LEN, PATH_MAX_LEN - 1, "/mnt/sandbox/%u/%s/storage/Users", info->uid / UID_BASE, varBundleName); if (ret <= 0) { - APPSPAWN_LOGE("snprintf storageUserPath failed, errno %{public}d", errno); + APPSPAWN_LOGW("snprintf storageUserPath failed, errno %{public}d", errno); return APPSPAWN_ERROR_UTILS_MEM_FAIL; } @@ -323,7 +323,7 @@ static int MountWithOther(const AppSpawningCtx *property, const AppDacInfo *info #endif ret = DoSharedMount(&arg); if (ret != 0) { - APPSPAWN_LOGE("mount %{public}s shared failed, ret %{public}d", storageUserPath, ret); + APPSPAWN_LOGW("mount %{public}s shared failed, ret %{public}d", storageUserPath, ret); } return ret; } @@ -342,7 +342,7 @@ static void MountStorageUsers(const AppSpawningCtx *property, const AppDacInfo * ret = MountWithFileMgr(property, info, varBundleName); } if (ret != 0) { - APPSPAWN_LOGE("Update %{public}s storage dir failed, ret %{public}d", + APPSPAWN_LOGW("Update %{public}s storage dir failed, ret %{public}d", checkRes == 0 ? "sharefs dir" : "no sharefs dir", ret); } else { APPSPAWN_LOGI("Update %{public}s storage dir success", checkRes == 0 ? "sharefs dir" : "no sharefs dir"); @@ -369,7 +369,7 @@ static int MountSharedMapItem(const AppSpawningCtx *property, const AppDacInfo * ret = MakeDirRec(sandboxPath, DIR_MODE, 1); if (ret != 0) { - APPSPAWN_LOGE("mkdir %{public}s failed, errno %{public}d", sandboxPath, errno); + APPSPAWN_LOGW("mkdir %{public}s failed, errno %{public}d", sandboxPath, errno); return APPSPAWN_SANDBOX_ERROR_MKDIR_FAIL; } @@ -434,7 +434,7 @@ static int AddDataGroupItemToQueue(AppSpawnMgr *content, const std::string &srcP if (strcpy_s(dataGroupNode->srcPath.path, PATH_MAX_LEN - 1, srcPath.c_str()) != EOK || strcpy_s(dataGroupNode->destPath.path, PATH_MAX_LEN - 1, destPath.c_str()) != EOK || strcpy_s(dataGroupNode->dataGroupUuid, UUID_MAX_LEN, dataGroupUuid.c_str()) != EOK) { - APPSPAWN_LOGE("strcpy dataGroupNode->srcPath failed"); + APPSPAWN_LOGW("strcpy dataGroupNode->srcPath failed"); free(dataGroupNode); return APPSPAWN_ERROR_UTILS_MEM_FAIL; } @@ -442,7 +442,7 @@ static int AddDataGroupItemToQueue(AppSpawnMgr *content, const std::string &srcP dataGroupNode->destPath.pathLen = strlen(dataGroupNode->destPath.path); ListNode *node = OH_ListFind(&content->dataGroupCtxQueue, (void *)dataGroupNode, DataGroupCtxNodeCompare); if (node != nullptr) { - APPSPAWN_LOGI("DataGroupCtxNode %{public}s is exist", dataGroupNode->srcPath.path); + APPSPAWN_LOGW("DataGroupCtxNode %{public}s is exist", dataGroupNode->srcPath.path); free(dataGroupNode); dataGroupNode = nullptr; return 0; @@ -554,7 +554,7 @@ int UpdateDataGroupDirs(AppSpawnMgr *content) int ret = snprintf_s(sandboxPath, PATH_MAX_LEN, PATH_MAX_LEN - 1, "%s%s", dataGroupNode->destPath.path, dataGroupNode->dataGroupUuid); if (ret <= 0) { - APPSPAWN_LOGE("snprintf_s sandboxPath: %{public}s failed, errno %{public}d", + APPSPAWN_LOGW("snprintf_s sandboxPath: %{public}s failed, errno %{public}d", dataGroupNode->destPath.path, errno); return APPSPAWN_ERROR_UTILS_MEM_FAIL; } @@ -569,7 +569,7 @@ int UpdateDataGroupDirs(AppSpawnMgr *content) }; ret = DoSharedMount(&args); if (ret != 0) { - APPSPAWN_LOGE("Shared mount %{public}s to %{public}s failed, errno %{public}d", args.srcPath, + APPSPAWN_LOGW("Shared mount %{public}s to %{public}s failed, errno %{public}d", args.srcPath, sandboxPath, ret); } node = node->next; @@ -604,7 +604,7 @@ static void MountDirToShared(AppSpawnMgr *content, const AppSpawningCtx *propert AppDacInfo *info = reinterpret_cast(GetAppProperty(property, TLV_DAC_INFO)); std::string varBundleName = ReplaceVarBundleName(property); if (info == nullptr || varBundleName == "") { - APPSPAWN_LOGE("Invalid app dac info or varBundleName"); + APPSPAWN_LOGW("Invalid app dac info or varBundleName"); return; } @@ -625,7 +625,7 @@ static void MountDirToShared(AppSpawnMgr *content, const AppSpawningCtx *propert lockSbxPathStamp += "_locked"; int ret = MakeDirRec(lockSbxPathStamp.c_str(), DIR_MODE, 1); if (ret != 0) { - APPSPAWN_LOGE("mkdir %{public}s failed, errno %{public}d", lockSbxPathStamp.c_str(), errno); + APPSPAWN_LOGW("mkdir %{public}s failed, errno %{public}d", lockSbxPathStamp.c_str(), errno); } } #endif diff --git a/util/include/appspawn_utils.h b/util/include/appspawn_utils.h index d8768344..7a451e20 100644 --- a/util/include/appspawn_utils.h +++ b/util/include/appspawn_utils.h @@ -214,6 +214,24 @@ int EnableNewNetNamespace(void); exper; \ } +#define APPSPAWN_CHECK_LOGV(retCode, exper, fmt, ...) \ + if (!(retCode)) { \ + APPSPAWN_LOGV(fmt, ##__VA_ARGS__); \ + exper; \ + } + +#define APPSPAWN_CHECK_LOGW(retCode, exper, fmt, ...) \ + if (!(retCode)) { \ + APPSPAWN_LOGW(fmt, ##__VA_ARGS__); \ + exper; \ + } + +#define APPSPAWN_CHECK_LOGI(retCode, exper, fmt, ...) \ + if (!(retCode)) { \ + APPSPAWN_LOGVI(fmt, ##__VA_ARGS__); \ + exper; \ + } + #define APPSPAWN_CHECK_ONLY_EXPER(retCode, exper) \ if (!(retCode)) { \ exper; \ @@ -228,6 +246,12 @@ int EnableNewNetNamespace(void); if (!(retCode)) { \ APPSPAWN_LOGE(fmt, ##__VA_ARGS__); \ } + +#define APPSPAWN_CHECK_ONLY_LOGW(retCode, fmt, ...) \ + if (!(retCode)) { \ + APPSPAWN_LOGW(fmt, ##__VA_ARGS__); \ + } + #ifdef __cplusplus } #endif // __cplusplus diff --git a/util/include/json_utils.h b/util/include/json_utils.h index 41369b83..10fed0f8 100644 --- a/util/include/json_utils.h +++ b/util/include/json_utils.h @@ -34,7 +34,7 @@ cJSON *GetJsonObjFromFile(const char *jsonPath); __attribute__((always_inline)) inline char *GetStringFromJsonObj(const cJSON *json, const char *key) { APPSPAWN_CHECK_ONLY_EXPER(key != NULL && json != NULL, NULL); - APPSPAWN_CHECK(cJSON_IsObject(json), return NULL, "json is not object %{public}s", key); + APPSPAWN_CHECK_LOGV(cJSON_IsObject(json), return NULL, "json is not object %{public}s", key); cJSON *obj = cJSON_GetObjectItemCaseSensitive(json, key); APPSPAWN_CHECK_ONLY_EXPER(obj != NULL, return NULL); APPSPAWN_CHECK(cJSON_IsString(obj), return NULL, "json is not string %{public}s", key); -- Gitee From d4131bb314fd11583ec6b89bd56da9dab3d730b1 Mon Sep 17 00:00:00 2001 From: fan-jingle Date: Mon, 4 Aug 2025 16:29:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fan-jingle --- modules/asan/asan_detector.c | 2 +- modules/common/appspawn_silk.c | 13 ++++------ modules/sandbox/normal/sandbox_common.cpp | 2 +- .../sandbox/normal/sandbox_shared_mount.cpp | 2 +- util/include/appspawn_utils.h | 24 +++++++++++++++++++ util/include/json_utils.h | 2 +- 6 files changed, 32 insertions(+), 13 deletions(-) diff --git a/modules/asan/asan_detector.c b/modules/asan/asan_detector.c index 3bbecf98..bdeb7cb9 100644 --- a/modules/asan/asan_detector.c +++ b/modules/asan/asan_detector.c @@ -125,7 +125,7 @@ static int CheckSupportColdStart(const char *bundleName) APPSPAWN_CHECK(len > 0 && (len < WRAP_VALUE_MAX_LENGTH), return -1, "Invalid to format wrapBundleNameKey"); int ret = GetParameter(wrapBundleNameKey, "", wrapBundleNameValue, WRAP_VALUE_MAX_LENGTH); - APPSPAWN_CHECK(ret > 0 && (!strcmp(wrapBundleNameValue, "asan_wrapper")), return -1, + APPSPAWN_CHECK_LOGV(ret > 0 && (!strcmp(wrapBundleNameValue, "asan_wrapper")), return -1, "Not wrap %{public}s.", bundleName); APPSPAWN_LOGI("Asan: GetParameter %{public}s the value is %{public}s.", wrapBundleNameKey, wrapBundleNameValue); return 0; diff --git a/modules/common/appspawn_silk.c b/modules/common/appspawn_silk.c index ee349404..2f8d9141 100644 --- a/modules/common/appspawn_silk.c +++ b/modules/common/appspawn_silk.c @@ -118,15 +118,10 @@ void LoadSilkConfig(void) bool LoadSilkLibrary(const char *packageName) { bool isSuccess = false; - if (g_silkConfig.configItems == NULL) { - APPSPAWN_LOGV("ConfigItems is NULL"); - return isSuccess; - } - if (packageName == NULL) { - APPSPAWN_LOGV("PackageName is NULL"); - FreeAllSilkConfig(); - return isSuccess; - } + APPSPAWN_CHECK_LOGV(g_silkConfig.configItems != NULL, return isSuccess, + "ConfigItems is NULL"); + APPSPAWN_CHECK_LOGV(packageName != NULL, FreeAllSilkConfig(); return isSuccess, + "PackageName is NULL"); char **appName = NULL; void *handle = NULL; for (int i = 0; i < g_silkConfig.configCursor; i++) { diff --git a/modules/sandbox/normal/sandbox_common.cpp b/modules/sandbox/normal/sandbox_common.cpp index 5552befe..92e457c0 100644 --- a/modules/sandbox/normal/sandbox_common.cpp +++ b/modules/sandbox/normal/sandbox_common.cpp @@ -989,7 +989,7 @@ int32_t SandboxCommon::DoAppSandboxMountOnce(const AppSpawningCtx *appProperty, struct timespec mountEnd = {0}; clock_gettime(CLOCK_MONOTONIC_COARSE, &mountEnd); uint64_t diff = DiffTime(&mountStart, &mountEnd); - APPSPAWN_CHECK_ONLY_LOG(diff < SandboxCommonDef::MAX_MOUNT_TIME, "mount %{public}s time %{public}" PRId64 " us", + APPSPAWN_CHECK_ONLY_LOGW(diff < SandboxCommonDef::MAX_MOUNT_TIME, "mount %{public}s time %{public}" PRId64 " us", arg->srcPath, diff); #ifdef APPSPAWN_HISYSEVENT APPSPAWN_CHECK_ONLY_EXPER(diff < FUNC_REPORT_DURATION, ReportAbnormalDuration(arg->srcPath, diff)); diff --git a/modules/sandbox/normal/sandbox_shared_mount.cpp b/modules/sandbox/normal/sandbox_shared_mount.cpp index 63a02377..e168faa5 100644 --- a/modules/sandbox/normal/sandbox_shared_mount.cpp +++ b/modules/sandbox/normal/sandbox_shared_mount.cpp @@ -196,7 +196,7 @@ static int MountEl1Bundle(const AppSpawningCtx *property, const AppDacInfo *info ret = umount2(targetPath, MNT_DETACH); if (ret != 0) { - APPSPAWN_LOGE("umount2 %{public}s failed, errno %{public}d", targetPath, errno); + APPSPAWN_LOGW("umount2 %{public}s failed, errno %{public}d", targetPath, errno); } SharedMountArgs arg = { diff --git a/util/include/appspawn_utils.h b/util/include/appspawn_utils.h index d8768344..7a451e20 100644 --- a/util/include/appspawn_utils.h +++ b/util/include/appspawn_utils.h @@ -214,6 +214,24 @@ int EnableNewNetNamespace(void); exper; \ } +#define APPSPAWN_CHECK_LOGV(retCode, exper, fmt, ...) \ + if (!(retCode)) { \ + APPSPAWN_LOGV(fmt, ##__VA_ARGS__); \ + exper; \ + } + +#define APPSPAWN_CHECK_LOGW(retCode, exper, fmt, ...) \ + if (!(retCode)) { \ + APPSPAWN_LOGW(fmt, ##__VA_ARGS__); \ + exper; \ + } + +#define APPSPAWN_CHECK_LOGI(retCode, exper, fmt, ...) \ + if (!(retCode)) { \ + APPSPAWN_LOGVI(fmt, ##__VA_ARGS__); \ + exper; \ + } + #define APPSPAWN_CHECK_ONLY_EXPER(retCode, exper) \ if (!(retCode)) { \ exper; \ @@ -228,6 +246,12 @@ int EnableNewNetNamespace(void); if (!(retCode)) { \ APPSPAWN_LOGE(fmt, ##__VA_ARGS__); \ } + +#define APPSPAWN_CHECK_ONLY_LOGW(retCode, fmt, ...) \ + if (!(retCode)) { \ + APPSPAWN_LOGW(fmt, ##__VA_ARGS__); \ + } + #ifdef __cplusplus } #endif // __cplusplus diff --git a/util/include/json_utils.h b/util/include/json_utils.h index 41369b83..10fed0f8 100644 --- a/util/include/json_utils.h +++ b/util/include/json_utils.h @@ -34,7 +34,7 @@ cJSON *GetJsonObjFromFile(const char *jsonPath); __attribute__((always_inline)) inline char *GetStringFromJsonObj(const cJSON *json, const char *key) { APPSPAWN_CHECK_ONLY_EXPER(key != NULL && json != NULL, NULL); - APPSPAWN_CHECK(cJSON_IsObject(json), return NULL, "json is not object %{public}s", key); + APPSPAWN_CHECK_LOGV(cJSON_IsObject(json), return NULL, "json is not object %{public}s", key); cJSON *obj = cJSON_GetObjectItemCaseSensitive(json, key); APPSPAWN_CHECK_ONLY_EXPER(obj != NULL, return NULL); APPSPAWN_CHECK(cJSON_IsString(obj), return NULL, "json is not string %{public}s", key); -- Gitee