下载zlog之后
解压
进入zlog目录
新建一个build_rk3588.sh脚本
内容如下
make CC=aarch64-linux-gcc PREFIX=./install_rk3588
将工具链导入环境变量
export PATH=/home/QMCY/RK3588/arm64tools/aarch64-buildroot-linux-gnu_sdk-buildroot/bin/:$PATH
编译无问题
产生的头文件zlog.h 和库文件libzlog.a 都在src目录下 copy到 工程目录即可
然后 zlog.conf 配置文件内容如下
[global]
strict init = true
buffer min = 1024
buffer max = 2048
file perms = 600
rotate lock file = self
[formats]
detail = "%d %-5V [%U %F %L] %m%n"
simple = "[%d %-5V]%m%n"
[rules]qmcy.* "./log/display.log", 3MB*5 ~ "./log/display-#r.log"; simple
status.* "./log/status.log", 3MB*5 ~ "./log/status-#r.log"; simple
*.* >stdout; simple
初始化:
板子上跑的实际效果如下