diff --git a/common/appspawn_server.c b/common/appspawn_server.c index 0eb3107cfcdc5c36a23f3d7ec3bcd5e7dd22f591..c6aa8597c0682bc0c59c94a976d4dc9f866b209f 100644 --- a/common/appspawn_server.c +++ b/common/appspawn_server.c @@ -33,7 +33,7 @@ static void NotifyResToParent(struct AppSpawnContent *content, AppSpawnClient *client, int result) { - APPSPAWN_LOGI("NotifyResToParent: %{public}d", result); + APPSPAWN_DUMP("NotifyResToParent: %{public}d", result); if (content->notifyResToParent != NULL) { content->notifyResToParent(content, client, result); } @@ -41,7 +41,7 @@ static void NotifyResToParent(struct AppSpawnContent *content, AppSpawnClient *c void ProcessExit(int code) { - APPSPAWN_LOGI("ExitCode:%{public}d", code); + APPSPAWN_DUMP("ExitCode:%{public}d", code); #ifdef OHOS_LITE _exit(0x7f); // 0x7f user exit #else @@ -121,7 +121,7 @@ int AppSpawnChild(AppSpawnContent *content, AppSpawnClient *client) static int CloneAppSpawn(void *arg) { APPSPAWN_CHECK(arg != NULL, return -1, "Invalid content for appspawn"); - APPSPAWN_LOGI("CloneNwebSpawn done."); + APPSPAWN_DUMP("CloneNwebSpawn done"); ffrt_child_init(); AppSpawnForkArg *forkArg = (AppSpawnForkArg *)arg; ProcessExit(AppSpawnChild(forkArg->content, forkArg->client)); diff --git a/modules/asan/asan_detector.c b/modules/asan/asan_detector.c index c0588a3d5663246064f3150114412cca2f7d6b42..73c5d1b08f473910dbd4d645e98d7fab8872177b 100644 --- a/modules/asan/asan_detector.c +++ b/modules/asan/asan_detector.c @@ -101,8 +101,8 @@ 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, - "Not wrap %{public}s.", bundleName); + APPSPAWN_CHECK_ONLY_EXPER(ret > 0 && (!strcmp(wrapBundleNameValue, "asan_wrapper")), + APPSPAWN_DUMP("Not wrap %{public}s", bundleName); return -1); APPSPAWN_LOGI("Asan: GetParameter %{public}s the value is %{public}s.", wrapBundleNameKey, wrapBundleNameValue); return 0; } diff --git a/modules/common/appspawn_encaps.c b/modules/common/appspawn_encaps.c index 3236e976b732994cb36379af9d3ed501616e3088..6573f62b7b6728b0c7646249105f2c462eaecac9 100644 --- a/modules/common/appspawn_encaps.c +++ b/modules/common/appspawn_encaps.c @@ -360,7 +360,7 @@ APPSPAWN_STATIC int SpawnSetEncapsPermissions(AppSpawnMgr *content, AppSpawningC ret = SpawnBuildEncaps(content, property, &encapsInfoStr); if (ret != 0) { close(encapsFileFd); - APPSPAWN_LOGW("Build encaps object failed, ret: %{public}d", ret); + APPSPAWN_LOGW("Build encaps failed %{public}d", ret); return 0; // Can't set permission encpas ability } diff --git a/modules/common/appspawn_silk.c b/modules/common/appspawn_silk.c index 37478b99a498c2f18321a84902020276a94614cb..277504413352ed823d51f71839fe249da4934c9c 100644 --- a/modules/common/appspawn_silk.c +++ b/modules/common/appspawn_silk.c @@ -114,10 +114,10 @@ static void FreeAllSilkConfig(void) void LoadSilkLibrary(const char *packageName) { - APPSPAWN_CHECK(g_silkConfig.configItems != NULL, return, - "ConfigItems is NULL"); - APPSPAWN_CHECK(packageName != NULL, FreeAllSilkConfig(); return, - "PackageName is NULL"); + APPSPAWN_CHECK_ONLY_EXPER(g_silkConfig.configItems != NULL, + APPSPAWN_DUMP("ConfigItems is NULL"); return); + APPSPAWN_CHECK_ONLY_EXPER(packageName != NULL, + FreeAllSilkConfig(); APPSPAWN_DUMP("PackageName is NULL"); return); char **appName = NULL; void *handle = NULL; for (int i = 0; i < g_silkConfig.configCursor; i++) { diff --git a/modules/sandbox/appspawn_sandbox.c b/modules/sandbox/appspawn_sandbox.c index a51e3803f1bc017cb7e12687250a210ce6527840..d33a9b9dcc36bb13dc3f7fa7c1bdc769400e9564 100644 --- a/modules/sandbox/appspawn_sandbox.c +++ b/modules/sandbox/appspawn_sandbox.c @@ -345,7 +345,7 @@ static int32_t SandboxMountFusePath(const SandboxContext *context, const MountAr APPSPAWN_STATIC void CheckAndCreateSandboxFile(const char *file) { if (access(file, F_OK) == 0) { - APPSPAWN_LOGI("file %{public}s already exist", file); + APPSPAWN_DUMP("file %{public}s exist", file); return; } MakeDirRec(file, FILE_MODE, 0); diff --git a/modules/sandbox/sandbox_shared_mount.cpp b/modules/sandbox/sandbox_shared_mount.cpp index c72f51654de4d3122c4309f58fe12f11ff7e1f7f..d39a12d5117ae024e3e55b9f4e09c7022205dde6 100644 --- a/modules/sandbox/sandbox_shared_mount.cpp +++ b/modules/sandbox/sandbox_shared_mount.cpp @@ -114,7 +114,7 @@ static bool IsUnlockStatus(uint32_t uid) std::string lockStatusParam = "startup.appspawn.lockstatus_" + std::to_string(uid); char userLockStatus[LOCK_STATUS_SIZE] = {0}; int ret = GetParameter(lockStatusParam.c_str(), "1", userLockStatus, sizeof(userLockStatus)); - APPSPAWN_LOGI("get param %{public}s %{public}s", lockStatusParam.c_str(), userLockStatus); + APPSPAWN_LOGI("lockStatus %{public}u %{public}s", uid, userLockStatus); if (ret > 0 && (strcmp(userLockStatus, "0") == 0)) { // 0:unlock status 1:lock status return true; } @@ -134,16 +134,16 @@ static int DoSharedMount(const SharedMountArgs *arg) int ret = mount(arg->srcPath, arg->destPath, arg->fsType, arg->mountFlags, arg->options); if (ret != 0) { - APPSPAWN_LOGE("mount %{public}s to %{public}s failed, errno %{public}d", + APPSPAWN_LOGE("mount %{public}s to %{public}s failed err %{public}d", arg->srcPath, arg->destPath, errno); return ret; } ret = mount(nullptr, arg->destPath, nullptr, arg->mountSharedFlag, nullptr); if (ret != 0) { - APPSPAWN_LOGE("mount path %{public}s to shared failed, errno %{public}d", arg->destPath, errno); + APPSPAWN_LOGE("mount path %{public}s failed err %{public}d", arg->destPath, errno); return ret; } - APPSPAWN_LOGI("mount path %{public}s to shared success", arg->destPath); + APPSPAWN_LOGI("mount path %{public}s success", arg->destPath); return 0; } @@ -151,7 +151,7 @@ static bool SetSandboxPathShared(const std::string &sandboxPath) { int ret = mount(nullptr, sandboxPath.c_str(), nullptr, MS_SHARED, nullptr); if (ret != 0) { - APPSPAWN_LOGW("Need to mount %{public}s to shared, errno %{public}d", sandboxPath.c_str(), errno); + APPSPAWN_LOGW("Need to mount %{public}s err %{public}d", sandboxPath.c_str(), errno); return false; } return true; diff --git a/modules/sandbox/sandbox_utils.cpp b/modules/sandbox/sandbox_utils.cpp index d84b281d5fc6ccd49ae8b7f15f5844d2fb5d8535..e19470a819b85df0a444a150be07da15e7d50a2d 100644 --- a/modules/sandbox/sandbox_utils.cpp +++ b/modules/sandbox/sandbox_utils.cpp @@ -220,7 +220,7 @@ static void MakeDirRecursive(const std::string &path, mode_t mode) std::string dir = path.substr(0, index); #ifndef APPSPAWN_TEST APPSPAWN_CHECK(!(access(dir.c_str(), F_OK) < 0 && mkdir(dir.c_str(), mode) < 0), - return, "errno is %{public}d, mkdir %{public}s failed", errno, dir.c_str()); + return, "err %{public}d mkdir %{public}s failed", errno, dir.c_str()); #endif } while (index < size); } @@ -242,7 +242,7 @@ static void MakeDirRecursiveWithClock(const std::string &path, mode_t mode) std::string dir = path.substr(0, index); #ifndef APPSPAWN_TEST APPSPAWN_CHECK(!(access(dir.c_str(), F_OK) < 0 && mkdir(dir.c_str(), mode) < 0), - return, "errno is %{public}d, mkdir %{public}s failed", errno, dir.c_str()); + return, "err %{public}d mkdir %{public}s failed", errno, dir.c_str()); #endif } while (index < size); @@ -353,7 +353,7 @@ int32_t SandboxUtils::DoAppSandboxMountOnce(const AppSpawningCtx *appProperty, c APPSPAWN_CHECK_ONLY_EXPER(diff < FUNC_REPORT_DURATION, ReportAbnormalDuration("MOUNT", diff)); #endif if (ret != 0) { - APPSPAWN_LOGI("errno is: %{public}d, bind mount %{public}s to %{public}s", errno, arg->srcPath, arg->destPath); + APPSPAWN_LOGI("err %{public}d bind mount %{public}s to %{public}s", errno, arg->srcPath, arg->destPath); if (errno == ENOENT && IsNeededCheckPathStatus(appProperty, arg->srcPath)) { CheckDirRecursive(arg->srcPath); } @@ -362,7 +362,7 @@ int32_t SandboxUtils::DoAppSandboxMountOnce(const AppSpawningCtx *appProperty, c ret = mount(nullptr, arg->destPath, nullptr, arg->mountSharedFlag, nullptr); if (ret != 0) { - APPSPAWN_LOGI("errno is: %{public}d, private mount to %{public}s '%{public}u' failed", + APPSPAWN_LOGI("err %{public}d private mount to %{public}s '%{public}u' failed", errno, arg->destPath, arg->mountSharedFlag); if (errno == EINVAL) { CheckMountStatus(arg->destPath); @@ -751,7 +751,7 @@ static int32_t DoDlpAppMountStrategy(const AppSpawningCtx *appProperty, umount2(sandboxPath.c_str(), MNT_DETACH); int fd = open("/dev/fuse", O_RDWR); - APPSPAWN_CHECK(fd != -1, return -EINVAL, "open /dev/fuse failed, errno is %{public}d", errno); + APPSPAWN_CHECK(fd != -1, return -EINVAL, "open /dev/fuse failed err %{public}d", errno); char options[OPTIONS_MAX_LEN]; (void)sprintf_s(options, sizeof(options), "fd=%d," @@ -774,7 +774,7 @@ static int32_t DoDlpAppMountStrategy(const AppSpawningCtx *appProperty, ret = mount(nullptr, sandboxPath.c_str(), nullptr, MS_SHARED, nullptr); APPSPAWN_CHECK(ret == 0, close(fd); - return ret, "errno is: %{public}d, private mount to %{public}s failed", errno, sandboxPath.c_str()); + return ret, "err %{public}d private mount to %{public}s failed", errno, sandboxPath.c_str()); #endif /* set DLP_FUSE_FD */ #ifdef WITH_DLP @@ -1009,7 +1009,7 @@ int SandboxUtils::DoAllSymlinkPointslink(const AppSpawningCtx *appProperty, nloh int ret = symlink(targetName.c_str(), linkName.c_str()); if (ret && errno != EEXIST) { - APPSPAWN_LOGE("errno is %{public}d, symlink failed, %{public}s", errno, linkName.c_str()); + APPSPAWN_LOGE("err %{public}d symlink failed %{public}s", errno, linkName.c_str()); std::string actionStatus = g_statusCheck; (void)JsonUtils::GetStringFromJson(symPoint, g_actionStatuc, actionStatus); @@ -1715,13 +1715,13 @@ int32_t SandboxUtils::ChangeCurrentDir(std::string &sandboxPackagePath, const st if (sandboxSharedStatus) { ret = chroot(sandboxPackagePath.c_str()); - APPSPAWN_CHECK(ret == 0, return ret, "chroot failed, path is %{public}s errno is %{public}d", + APPSPAWN_CHECK(ret == 0, return ret, "chroot failed path %{public}s err %{public}d", sandboxPackagePath.c_str(), errno); return ret; } ret = syscall(SYS_pivot_root, sandboxPackagePath.c_str(), sandboxPackagePath.c_str()); - APPSPAWN_CHECK(ret == 0, return ret, "errno is %{public}d, pivot root failed, packagename is %{public}s", + APPSPAWN_CHECK(ret == 0, return ret, "err %{public}d pivot root failed packagename %{public}s", errno, bundleName.c_str()); ret = umount2(".", MNT_DETACH); @@ -1901,13 +1901,13 @@ int32_t SandboxUtils::SetAppSandboxPropertyNweb(AppSpawningCtx *appProperty, uin if (sandboxSharedStatus) { rc = chroot(sandboxPackagePath.c_str()); - APPSPAWN_CHECK(rc == 0, return rc, "chroot failed, path is %{public}s errno is %{public}d", + APPSPAWN_CHECK(rc == 0, return rc, "chroot failed path %{public}s err %{public}d", sandboxPackagePath.c_str(), errno); return 0; } rc = syscall(SYS_pivot_root, sandboxPackagePath.c_str(), sandboxPackagePath.c_str()); - APPSPAWN_CHECK(rc == 0, return rc, "errno is %{public}d, pivot root failed, packagename is %{public}s", + APPSPAWN_CHECK(rc == 0, return rc, "err %{public}d pivot root failed packagename %{public}s", errno, bundleName.c_str()); rc = umount2(".", MNT_DETACH); diff --git a/standard/BUILD.gn b/standard/BUILD.gn index ae540d4da6440da2cb4ed3ed384f53e517813d10..a283868fbba8ed218aa202a28dc704a858cbf49b 100644 --- a/standard/BUILD.gn +++ b/standard/BUILD.gn @@ -140,6 +140,8 @@ ohos_shared_library("appspawn_helper") { "init:libbegetutil", ] + deps = ["${appspawn_path}/util:libappspawn_util"] + install_enable = true subsystem_name = "${subsystem_name}" part_name = "${part_name}" diff --git a/standard/appspawn_kickdog.c b/standard/appspawn_kickdog.c index 04a7db138c948d06e14b057fb46df161a47d273e..95059e5513fffadb90eb4b57dc7a3145ca0150e7 100644 --- a/standard/appspawn_kickdog.c +++ b/standard/appspawn_kickdog.c @@ -73,9 +73,9 @@ static void DealSpawnWatchdog(AppSpawnContent *content, bool isOpen) if (isOpen) { content->wdgOpened = (result != -1); } - APPSPAWN_LOGI("%{public}s %{public}s %{public}s watchdog end,result:%{public}d", + APPSPAWN_DUMP("%{public}s %{public}s %{public}s dog end %{public}d", content->isLinux ? "Linux" : "Hm", (content->mode == MODE_FOR_NWEB_SPAWN) ? - "Nwebspawn" : "Appspawn", isOpen ? "enable" : "kick", result); + "Nweb" : "App", isOpen ? "enable" : "kick", result); } static void ProcessTimerHandle(const TimerHandle taskHandle, void *context) diff --git a/standard/appspawn_msgmgr.c b/standard/appspawn_msgmgr.c index 2e844d93a49d9f09810b90df8b0fae5b9ed63a07..668f953d1343a55f575c44d566de5f8620b66bbf 100644 --- a/standard/appspawn_msgmgr.c +++ b/standard/appspawn_msgmgr.c @@ -39,7 +39,7 @@ void *GetAppSpawnMsgExtInfo(const AppSpawnMsgNode *message, const char *name, ui APPSPAWN_CHECK_ONLY_EXPER(message != NULL && message->buffer != NULL, return NULL); APPSPAWN_CHECK_ONLY_EXPER(message->tlvOffset != NULL, return NULL); - APPSPAWN_LOGV("GetAppSpawnMsgExtInfo tlvCount %{public}d name %{public}s", message->tlvCount, name); + APPSPAWN_LOGV("tlvCount %{public}d name %{public}s", message->tlvCount, name); for (uint32_t index = TLV_MAX; index < (TLV_MAX + message->tlvCount); index++) { if (message->tlvOffset[index] == INVALID_OFFSET) { return NULL; @@ -349,7 +349,7 @@ int GetAppSpawnMsgFromBuffer(const uint8_t *buffer, uint32_t bufferLen, static inline void DumpMsgFlags(const char *processName, const char *info, const AppSpawnMsgFlags *msgFlags) { for (uint32_t i = 0; i < msgFlags->count; i++) { - APPSPAWN_DUMP("processName: %{public}s %{public}d %{public}s flags: 0x%{public}x", + APPSPAWN_DUMP("%{public}s %{public}d %{public}s flags:0x%{public}x", processName, i, info, msgFlags->flags[i]); } } @@ -357,7 +357,7 @@ static inline void DumpMsgFlags(const char *processName, const char *info, const static inline void DumpMsgExtInfo(const AppSpawnTlv *tlv) { if (tlv->tlvType != TLV_MAX) { - APPSPAWN_DUMP("App tlv info: [%{public}d %{public}d]", tlv->tlvType, tlv->tlvLen); + APPSPAWN_DUMP("tlvinfo:[%{public}d %{public}d]", tlv->tlvType, tlv->tlvLen); return; } AppSpawnTlvExt *tlvExt = (AppSpawnTlvExt *)(tlv); @@ -365,25 +365,25 @@ static inline void DumpMsgExtInfo(const AppSpawnTlv *tlv) APPSPAWN_LOGV("App extend info name: %{public}s len: %{public}u value: '%{public}s'", tlvExt->tlvName, tlvExt->dataLen, (char *)(tlvExt + 1)); } else { - APPSPAWN_DUMP("AppExtendName:%{public}s len:%{public}u", tlvExt->tlvName, tlvExt->dataLen); + APPSPAWN_DUMP("tlvName:%{public}s len:%{public}u", tlvExt->tlvName, tlvExt->dataLen); } } void DumpAppSpawnMsg(const AppSpawnMsgNode *message) { APPSPAWN_CHECK_ONLY_EXPER(message != NULL, return); - APPSPAWN_DUMP("App spawn msg msgId: %{public}u msgLen: %{public}u tlvCount: %{public}u processName: %{public}s", + APPSPAWN_DUMP("msgId:%{public}u msgLen:%{public}u tlvCount:%{public}u processName:%{public}s", message->msgHeader.msgId, message->msgHeader.msgLen, message->tlvCount, message->msgHeader.processName); AppSpawnMsgFlags *msgFlags = (AppSpawnMsgFlags *)GetAppSpawnMsgInfo(message, TLV_MSG_FLAGS); APPSPAWN_ONLY_EXPER(msgFlags != NULL, DumpMsgFlags(message->msgHeader.processName, "App", msgFlags)); msgFlags = (AppSpawnMsgFlags *)GetAppSpawnMsgInfo(message, TLV_PERMISSION); APPSPAWN_ONLY_EXPER(msgFlags != NULL, - DumpMsgFlags(message->msgHeader.processName, "App permission bits", msgFlags)); + DumpMsgFlags(message->msgHeader.processName, "PermissionBits", msgFlags)); AppSpawnMsgDacInfo *dacInfo = (AppSpawnMsgDacInfo *)GetAppSpawnMsgInfo(message, TLV_DAC_INFO); if (dacInfo != NULL) { - APPSPAWN_DUMP("App dac info uid: %{public}d gid: %{public}d count: %{public}d", + APPSPAWN_DUMP("dac uid:%{public}d gid:%{public}d count:%{public}d", dacInfo->uid, dacInfo->gid, dacInfo->gidCount); for (uint32_t i = 0; i < dacInfo->gidCount; i++) { APPSPAWN_DUMP("gid group[%{public}d]: %{public}d", i, dacInfo->gidTable[i]); @@ -396,7 +396,7 @@ void DumpAppSpawnMsg(const AppSpawnMsgNode *message) AppSpawnMsgDomainInfo *domainInfo = (AppSpawnMsgDomainInfo *)GetAppSpawnMsgInfo(message, TLV_DOMAIN_INFO); APPSPAWN_ONLY_EXPER(domainInfo != NULL, - APPSPAWN_DUMP("App DomainHap:0x%{public}x apl:\"%{public}s\"", domainInfo->hapFlags, domainInfo->apl)); + APPSPAWN_DUMP("hapFlags:0x%{public}x apl:\"%{public}s\"", domainInfo->hapFlags, domainInfo->apl)); AppSpawnMgr *mgr = GetAppSpawnMgr(); if (mgr == NULL || ((mgr->flags & APP_DEVELOPER_MODE) != APP_DEVELOPER_MODE)) { diff --git a/standard/appspawn_service.c b/standard/appspawn_service.c index c14ce87c90de1f32dffa2056003b7969b845495f..697257fc3390af14ae4b5002d63884da9521e8bd 100644 --- a/standard/appspawn_service.c +++ b/standard/appspawn_service.c @@ -271,7 +271,7 @@ static void OnDisConnect(const TaskHandle taskHandle) { AppSpawnConnection *connection = (AppSpawnConnection *)LE_GetUserData(taskHandle); APPSPAWN_CHECK(connection != NULL, return, "Invalid connection"); - APPSPAWN_LOGI("OnDisConnect connectionId: %{public}u socket %{public}d", + APPSPAWN_LOGI("connectionId:%{public}u socket:%{public}d", connection->connectionId, LE_GetSocketFd(taskHandle)); OnClose(taskHandle); } @@ -289,7 +289,7 @@ static void SendMessageComplete(const TaskHandle taskHandle, BufferHandle handle if (appInfo == NULL) { return; } - APPSPAWN_LOGI("SendMessageComplete connectionId: %{public}u result %{public}d app %{public}s pid %{public}d", + APPSPAWN_LOGI("connectionId:%{public}u ret:%{public}d app:%{public}s pid:%{public}d", connection->connectionId, LE_GetSendResult(handle), appInfo->name, msg->result.pid); if (LE_GetSendResult(handle) != 0 && msg->result.pid > 0) { kill(msg->result.pid, SIGKILL); @@ -298,7 +298,7 @@ static void SendMessageComplete(const TaskHandle taskHandle, BufferHandle handle static int SendResponse(const AppSpawnConnection *connection, const AppSpawnMsg *msg, int result, pid_t pid) { - APPSPAWN_LOGV("SendResponse connectionId: %{public}u result: 0x%{public}x pid: %{public}d", + APPSPAWN_LOGV("connectionId:%{public}u ret:0x%{public}x pid:%{public}d", connection->connectionId, result, pid); uint32_t bufferSize = sizeof(AppSpawnResponseMsg); BufferHandle handle = LE_CreateBuffer(LE_GetDefaultLoop(), bufferSize); @@ -427,7 +427,7 @@ static int OnConnection(const LoopHandle loopHandle, const TaskHandle server) connection->receiverCtx.timer = NULL; connection->receiverCtx.msgRecvLen = 0; connection->receiverCtx.nextMsgId = 1; - APPSPAWN_LOGI("OnConnection connectionId: %{public}u fd %{public}d ", + APPSPAWN_LOGI("connectionId:%{public}u fd:%{public}d", connection->connectionId, LE_GetSocketFd(stream)); return 0; } @@ -446,7 +446,7 @@ APPSPAWN_STATIC bool MsgDevicedebugCheck(TaskHandle stream, AppSpawnMsgNode *mes AppSpawnMsg *msg = &message->msgHeader; if (msg->msgType != MSG_DEVICE_DEBUG) { - APPSPAWN_LOGE("appspawn devicedebug msg type is not devicedebug [%{public}d]", msg->msgType); + APPSPAWN_LOGE("type mismatch msgType [%{public}d]", msg->msgType); return false; } @@ -467,7 +467,7 @@ static void OnReceiveRequest(const TaskHandle taskHandle, const uint8_t *buffer, connection->receiverCtx.incompleteMsg = NULL; int ret = 0; do { - APPSPAWN_LOGI("OnReceiveRequest connectionId: %{public}u start: 0x%{public}x buffLen %{public}d", + APPSPAWN_LOGI("connectionId:%{public}u start:0x%{public}x buffLen:%{public}d", connection->connectionId, *(uint32_t *)(buffer + currLen), buffLen - currLen); ret = GetAppSpawnMsgFromBuffer(buffer + currLen, buffLen - currLen, @@ -565,7 +565,7 @@ APPSPAWN_STATIC int WriteMsgToChild(AppSpawningCtx *property, bool isNweb) static int InitForkContext(AppSpawningCtx *property) { if (pipe(property->forkCtx.fd) == -1) { - APPSPAWN_LOGE("create pipe fail, errno: %{public}d", errno); + APPSPAWN_LOGE("create pipe fail err:%{public}d", errno); return errno; } int option = fcntl(property->forkCtx.fd[0], F_GETFD); @@ -591,7 +591,7 @@ static void ProcessChildProcessFd(const WatcherHandle taskHandle, int fd, uint32 { APPSPAWN_CHECK_ONLY_EXPER(context != NULL, return); pid_t pid = *(pid_t *)context; - APPSPAWN_LOGI("Clear process group with pid %{public}d, pidFd %{public}d", pid, fd); + APPSPAWN_LOGI("Clear process group with pid:%{public}d pidFd:%{public}d", pid, fd); AppSpawnedProcess *appInfo = GetSpawnedProcess(pid); if (appInfo == NULL) { APPSPAWN_LOGW("Cannot get app info by bundle name: %{public}d", pid); diff --git a/util/include/appspawn_utils.h b/util/include/appspawn_utils.h index 2ab428c73b7dc0a697ed517bb2de610df4563c88..e654f76fbf72e06277c3dd00b11a26aab1074848 100644 --- a/util/include/appspawn_utils.h +++ b/util/include/appspawn_utils.h @@ -190,6 +190,8 @@ int EnableNewNetNamespace(void); #else +#define APPSPAWN_DUMP(fmt, ...) \ + HILOG_INFO(HILOG_MODULE_HIVIEW, fmt, ##__VA_ARGS__) #define APPSPAWN_LOGI(fmt, ...) \ HILOG_INFO(HILOG_MODULE_HIVIEW, "[%{public}s:%{public}d]" fmt, (APP_FILE_NAME), (__LINE__), ##__VA_ARGS__) #define APPSPAWN_LOGE(fmt, ...) \