C++ 中重写 ALOG 动态 控制宏控

#include <cutils/log.h>

////////log define ////////////////////////
#define LOG_TAG "receivedata"

#define HICAR_LOG_ENABLE

#ifdef HICAR_LOG_ENABLE

#ifndef ALOGI_D
#define ALOGI_D(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
#endif

#else

#ifndef ALOGI_D
#define ALOGI_D(...) ((void)0)
#endif


#endif

支持如下几种:
LOG_VERBOSE
LOG_DEBUG
LOG_INFO
LOG_WARN
LOG_ERROR

发布了329 篇原创文章 · 获赞 66 · 访问量 10万+

猜你喜欢

转载自blog.csdn.net/Ciellee/article/details/102457563