In CPP code, for ex in camera HAL, ALOGD messages are not being printed. Like in set_preview_window() ALOGD("set_preview_window : X, rc %d", rc); How to enable them?
try to add following statements in the files which you wanted to catch logs.
#define LOG_NDEBUG 0
#define LOG_NIDEBUG 0
#define LOG_NDDEBUG 0
After compiled, you can try to get logs through adb logcat.
These macros (ALOGX...) are defined in some system core C/C++ headers. You can find an example in system/core/include/log/log.h (AOSP 6.0.0r1)
Sometimes you need to add liblog in LOCAL_SHARED_LIBRARIES of the corresponding Android.mk :
LOCAL_SHARED_LIBRARIES := ... liblog
Also, you might need to add two lines at the top of C/C++ concerned source files :
#define LOG_NDEBUG 0
#define LOG_TAG "LibName"
Don't forget LOG_NDEBUG 0 if you want ALOGV() logs. After rebuilding the lib/module, you should be able to see logs in your logcat.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With