\system\core\rootdir\init.rc
service console /system/bin/sh
class core
console
disabled
user root
group shell log readproc
seclabel u:r?s0
on property:ro.debuggable=1
# Give writes to anyone for the trace folder on debug builds.
# The folder is used to store method traces.
chmod 0773 /data/misc/trace
start console
on property:ro.debuggable=0
# Give writes to anyone for the trace folder on debug builds.
# The folder is used to store method traces.
chmod 0773 /data/misc/trace
start console
可以使用下面命令设置当前日志级别:
echo 8 > /proc/sys/kernel/printk
这样所有级别小于8的都可以打印在控制台终端上了