I am trying to print log messages within core Android framework files. For example, I tried logging messages within MediaRecorderClient.cpp
under frameworks\base\media\libmediaplayerservice\
. I've tried LOGV
, LOGE
, LOGD
, printf
, and __android_log_print
, without any success.
Which command should I use to print log messages?
Log should be used, but it will print to logcat not system print.
Example:
Log.d("filter", example text); // filter is any tag you want to use as filter
You can open logcat in eclipse from window-show view -> other -> android -> logcat
What kind of error do you receive? If it does not compile, make sure you've included <android/log.h>, also in Android.mk:
LOCAL_LDLIBS := -llog
If it compiles but does not produce any output, then, like @Warpzit has said, you have to look at logcat to see your messages.
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