OpenHarmony ArkTS 框架下打印日志,两个地方需要处理一下:
1,解除开发板日志限流命令:
(1) hdc_std shell param set hilog.flowctrl.proc.on false
(2) hdc_std shell hilog -Q pidoff
(3) hdc_std shell hilog -p off
(4) hdc_std shell hilog -b D
2,日志过长,分段打印
printAllMsg(tag: string, msg: string, isFirstPrint:boolean=true,eachPrintLength:number=900) {
if (isFirstPrint) {
console.info(tag+ 'msg print start-->')
}
if (msg && msg.length <= eachPrintLength) {
console.info(tag+ msg);
console.info(tag+ 'msg print end');
} else if (msg && msg.length > eachPrintLength) {
console.info(tag+msg.substr(0, eachPrintLength));
console.info(tag+'msg print next-->:');
let nextMsg: string = msg.substr(eachPrintLength, msg.length)
printAllMsg(tag, nextMsg, false)
} else {
console.info(tag+ ':msg is undefined');
}
}
最后
以上就是大意巨人最近收集整理的关于OpenHarmony ArkTS 框架下打印日志不全解决办法的全部内容,更多相关OpenHarmony内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复