Android系统logcat实现分析

一、在程序中添加

1.java部分

frameworks/base/core/java/android/util/Log.java

frameworks/base/core/jni/android_util_Log.cpp

system/core/liblog/logd_write.c

2.C++部分

system/core/liblog/logd_write.c

二、logcat调试命令

system/core/logcat/logcat.cpp

system/core/liblog/log_read.c

三、内核实现

Kernel3.10.40/drivers/staging/android/logger.c

对应不同打印级别的设备节点:

<span style="font-size:14px;">shell@pitaya:/dev/log $ ls -l
crw-rw-rw- root     log       10,  58 2007-01-01 20:00 events
crw-rw-rw- root     log       10,  59 2007-01-01 20:00 main
crw-rw-rw- root     log       10,  57 2007-01-01 20:00 radio
crw-rw-rw- root     log       10,  56 2007-01-01 20:00 system</span>


你可能感兴趣的:(Android系统logcat实现分析)