同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
HiLog_Lite is the HiLog framework for Mini-System Devices (reference memory ≥ 128 KiB) and Small-System Devices (reference memory ≥ 1 MiB). It implements functions such as log printing, log output, and flow control.
HiLog_lite provides the following C APIs:
HILOG_DEBUG(mod, fmt, ...)
HILOG_INFO/HILOG_WARN/HILOG_ERROR/HILOG_FATAL
Table 1 Parameters of C APIs
The following provides an example of how the Samgr_Lite module uses the HiLog_Lite framework.
Add the module ID, and define HILOG_MODULE_SAMGR in the HiLogModuleType structure in base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite/hiview_log.h.
typedef enum {
...
HILOG_MODULE_SAMGR,
...
} HiLogModuleType;
Register the module. Specifically, add the registration code to the HiLogInit function in base/hiviewdfx/hilog_lite/frameworks/mini/hiview_log.c.
HiLogRegisterModule(HILOG_MODULE_SAMGR, "SAMGR");
Add the header file dependencies to the foundation/systemabilitymgr/samgr_lite/samgr/BUILD.gn file.
include_dirs = [
"//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite",
]
Reference the header file in the foundation/systemabilitymgr/samgr_lite/samgr/source/message.c file and call the related APIs.
#include <log.h>
uint32 *SAMGR_SendSharedRequest(const Identity *identity, const Request *request, uint32 *token, Handler handler)
{
...
if (err != EC_SUCCESS) {
HILOG_ERROR(HILOG_MODULE_SAMGR, "SharedSend [%p] failed(%d)!", identity->queueId, err);
(void)FreeReference(&exchange);
}
...
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。