天天看點

android logcat 系統 分析,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

對應不同列印級别的裝置節點:

[email protected]:/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