summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2015-04-23 22:29:28 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-23 22:29:28 +0000
commit2b70a6501f35db890d3ff81254c0bba13e039a28 (patch)
tree15495287ff63112a1e1c34e768f40364c68242a3
parentb259b5fb86fb4ca615992f30bfa5011b28f00d09 (diff)
parent9277b01138decd65cd98cd4265789369cb9797b7 (diff)
downloadsystem_core-2b70a6501f35db890d3ff81254c0bba13e039a28.zip
system_core-2b70a6501f35db890d3ff81254c0bba13e039a28.tar.gz
system_core-2b70a6501f35db890d3ff81254c0bba13e039a28.tar.bz2
am 9277b011: am 9d4b3010: am 2ce1d81f: Merge "liblog: __android_log_is_loggable support Developer Options"
* commit '9277b01138decd65cd98cd4265789369cb9797b7': liblog: __android_log_is_loggable support Developer Options
-rw-r--r--liblog/log_is_loggable.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/liblog/log_is_loggable.c b/liblog/log_is_loggable.c
index df67123..2e09192 100644
--- a/liblog/log_is_loggable.c
+++ b/liblog/log_is_loggable.c
@@ -28,7 +28,7 @@ static int __android_log_level(const char *tag, int def)
return def;
}
{
- static const char log_namespace[] = "log.tag.";
+ static const char log_namespace[] = "persist.log.tag.";
char key[sizeof(log_namespace) + strlen(tag)];
strcpy(key, log_namespace);
@@ -37,6 +37,9 @@ static int __android_log_level(const char *tag, int def)
if (__system_property_get(key + 8, buf) <= 0) {
buf[0] = '\0';
}
+ if (!buf[0] && __system_property_get(key, buf) <= 0) {
+ buf[0] = '\0';
+ }
}
switch (toupper(buf[0])) {
case 'V': return ANDROID_LOG_VERBOSE;
@@ -53,17 +56,6 @@ static int __android_log_level(const char *tag, int def)
int __android_log_is_loggable(int prio, const char *tag, int def)
{
- static char user;
- int logLevel;
-
- if (user == 0) {
- char buf[PROP_VALUE_MAX];
- if (__system_property_get("ro.build.type", buf) <= 0) {
- buf[0] = '\0';
- }
- user = strcmp(buf, "user") ? -1 : 1;
- }
-
- logLevel = (user == 1) ? def : __android_log_level(tag, def);
+ int logLevel = __android_log_level(tag, def);
return logLevel >= 0 && prio >= logLevel;
}