The is one more simple way to put logs in native library of android. You have to following the methon as explained below.
1) First of all check weather you your lib is linking with libutils and libcutils if not just add these flags in LOCAL_SHARED_LIBRARIES in your library’s Android.mk
2) Now include #include <utils/Log.h> header file.
3) Define LOG_TAG micro with some value. You can use this value to filter logs in logcat.
#define LOG_TAG “YS”
3) After this you can use below mero functions to put logs LOGV, LOGI, LOGW, LOGF, LOGS.
for example LOGV(“This is my log statement on line %d”,__LINE__);
I hope this method of putting logs is more easy and simple .