How to print log messages with in Android framework

Eric Lin picture Eric Lin · Nov 29, 2011 · Viewed 12.2k times · Source

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?

Answer

Warpzit picture Warpzit · Nov 29, 2011

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