请教 __android_log_print,LOG_TAG 问题和原理

sinkary sinkary 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
In Android 4.0.3,
I modified the file "system/core/include/cutils/log.h"
I added the code below:

/*
* my log for trace code
*/
#ifndef MYNO
#define MYNO
static long myNo = 0;
#endif
//
#ifndef MYLOG
#define MYLOG(...) \
__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, "***It's My Log!*** No. %ld: ", myNo); \
__android_log_print(ANDROID_LOG_ERROR, NULL, __VA_ARGS__); \
myNo++;
#endif

When i use logcat -s InputReader to see my log, i can only see:
E/InputReader( 308): ***It's My Log!*** No. 0:
E/InputReader( 308): ***It's My Log!*** No. 1:

Must I change the second __android_log_print: NULL to LOG_CAT?
But I want to see the input events show after the number.

I really track the MACRO to know why, but I just can's get the reason.
How can I solve this problem?
...全文

相关推荐

评论 6
收藏 已收藏
分享
返回顶部
sinkary
Android 80,490 成员 91,371 内容