OSDN Git Service

jni: isLoggable calls __android_log_is_loggable
authorMark Salyzyn <salyzyn@google.com>
Fri, 24 Apr 2015 22:55:40 +0000 (15:55 -0700)
committerMark Salyzyn <salyzyn@google.com>
Sat, 13 Jun 2015 12:07:47 +0000 (05:07 -0700)
Will inherit additional functionality and cache improvements

Bug: 17760225
Change-Id: Iab1816d37cc74343d83629d851a5784d4865ebb4

core/jni/android_util_Log.cpp

index 9a80f1d..2b1067b 100644 (file)
@@ -41,32 +41,8 @@ struct levels_t {
 };
 static levels_t levels;
 
-static int toLevel(const char* value)
-{
-    switch (value[0]) {
-        case 'V': return levels.verbose;
-        case 'D': return levels.debug;
-        case 'I': return levels.info;
-        case 'W': return levels.warn;
-        case 'E': return levels.error;
-        case 'A': return levels.assert;
-        case 'S': return -1; // SUPPRESS
-    }
-    return levels.info;
-}
-
 static jboolean isLoggable(const char* tag, jint level) {
-    String8 key;
-    key.append(LOG_NAMESPACE);
-    key.append(tag);
-
-    char buf[PROPERTY_VALUE_MAX];
-    if (property_get(key.string(), buf, "") <= 0) {
-        buf[0] = '\0';
-    }
-
-    int logLevel = toLevel(buf);
-    return logLevel >= 0 && level >= logLevel;
+    return __android_log_is_loggable(level, tag, ANDROID_LOG_INFO);
 }
 
 static jboolean android_util_Log_isLoggable(JNIEnv* env, jobject clazz, jstring tag, jint level)