log.tag.<tag> cache
log_namespace = "persist.log.tag.";
/*
* Single layer cache of four properties. Priorities are:
* log.tag.<tag>
* persist.log.tag.<tag>
* log.tag
* persist.log.tag
* Where the missing tag matches all tags and becomes the
* system global default. We do not support ro.log.tag* .
*/
typedef enum android_LogPriority {
74 /** For internal use only. */
75 ANDROID_LOG_UNKNOWN = 0,
76 /** The default priority, for internal use only. */
77 ANDROID_LOG_DEFAULT, /* only for SetMinPriority() */
78 /** Verbose logging. Should typically be disabled for a release apk. */
79 ANDROID_LOG_VERBOSE,
80 /** Debug logging. Should typically be disabled for a release apk. */
81 ANDROID_LOG_DEBUG,
82 /** Informational logging. Should typically be disabled for a release apk. */
83 ANDROID_LOG_INFO,
84 /** Warning logging. For use with recoverable failures. */
85 ANDROID_LOG_WARN,
86 /** Error logging. For use with unrecoverable failures. */
87 ANDROID_LOG_ERROR,
88 /** Fatal logging. For use when aborting. */
89 ANDROID_LOG_FATAL,
90 /** For internal use only. */
91 ANDROID_LOG_SILENT, /* only for SetMinPriority(); must be last */
92 } android_LogPriority;
93
adb shell setprop persist.log.tag S
__android_log_print
__android_log_set_minimum_priority
__android_log_is_debuggable
__android_log_is_loggable
system/libbase/logging.cpp
InitLogging里面根据环境变量ANDROID_LOG_TAGS来设置日志等级SetMinimumLogSeverity
定义日志函数
system/core/liblog/logger_write.cpp
全局控制可以在.rc 文件里面
on early-boot && property:ro.build.type=userdebug
export ANDROID_LOG_TAGS "*:d"
adb 命令
adb shell setprop persist.log.tag S
针对特定TAG 控制
system.prop中
设置属性 log.tag.XXX=S
adb shell setprop log.tag.XXX D
427

被折叠的 条评论
为什么被折叠?



