/dev/log/events. One for kernel space log:
/dev/log/events. Those log messages with the tag "HTC_RIL" "RILJ" "RILC" "RILD" "RIL" "AT" "GSM" "STK" will be written to
/dev/log/radio. Other log messages will be written to
/dev/log/kernelis for kernel log message collection. A console is registered in
/dev/log/kerneland collect all the
printkoutput to the device. It will output kernel log messages with the same log format as other log devices.
Logcatis a tool provided by Android. It could read log messages from log devices and output to the console or to a file. You can find the detail usage later.
aplogdaemon is added for offline log. A filter is added to do some security checking.
ERROR, WARN, INFO, DEBUG, VERBOSE.
VERBOSEshould never be compiled into an application except during development.
DEBUGlogs are compiled in but stripped at runtime.
INFOlogs are always kept.
TIP: A good convention is to declare a TAG constant in your class:
private static final String TAG = "TAG_MyActivity";>and use that in subsequent calls to the log methods.
Log.v(TAG, "index=" + i);When you're building the string to pass into Log.d, Java uses a StringBuilder and at least three allocations occur: the StringBuilder itself, the buffer, and the String object. Realistically, there is also another buffer allocation and copy, and even more pressure on the GC. That means that if your log message is filtered out, you might be doing significant work and incurring significant overhead.
include <cutils/log.h>###Logging Macros
- 1.You should define LOG_TAG in your C source code firstly.
- 2.To build out C/C++ applications outside android, you should add
LOCAL_SHARED_LIBRARIES := liblog libcutilsin your Android.mk file
v, d, i, w, e## Log format on Android The format of a log messages is