openharmony实现NAPI端打印数据
·
1、在CMakeLists.txt中加上
# 增加hiloglib库引用 find_library( # Sets the name of the path variable. hilog-lib # Specifies the name of the NDK library that # you want CMake to locate. hilog_ndk.z )
2、增加hiloglib库链接
target_link_libraries(entry PUBLIC ${hilog-lib} libace_napi.z.so)
3、在C++中加上头文件
#include <hilog/log.h>
4、增加打印语句
OH_LOG_Print(LOG_APP, LOG_DEBUG, 0xFF00, "Modbus", "----Read registers failed:%{public}d", regs);
更多推荐
所有评论(0)