Merge "If ProtoLog is not required, add fallback to logcat" into udc-qpr-dev
This commit is contained in:
@@ -510,6 +510,17 @@ filegroup {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// common protolog sources without classes that rely on Android SDK
|
||||||
|
filegroup {
|
||||||
|
name: "protolog-common-no-android-src",
|
||||||
|
srcs: [
|
||||||
|
":protolog-common-src",
|
||||||
|
],
|
||||||
|
exclude_srcs: [
|
||||||
|
"com/android/internal/protolog/common/ProtoLog.java",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
java_library {
|
java_library {
|
||||||
name: "protolog-lib",
|
name: "protolog-lib",
|
||||||
platform_apis: true,
|
platform_apis: true,
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.internal.protolog.common;
|
package com.android.internal.protolog.common;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ProtoLog API - exposes static logging methods. Usage of this API is similar
|
* ProtoLog API - exposes static logging methods. Usage of this API is similar
|
||||||
* to {@code android.utils.Log} class. Instead of plain text log messages each call consists of
|
* to {@code android.utils.Log} class. Instead of plain text log messages each call consists of
|
||||||
@@ -53,6 +55,9 @@ public class ProtoLog {
|
|||||||
throw new UnsupportedOperationException(
|
throw new UnsupportedOperationException(
|
||||||
"ProtoLog calls MUST be processed with ProtoLogTool");
|
"ProtoLog calls MUST be processed with ProtoLogTool");
|
||||||
}
|
}
|
||||||
|
if (group.isLogToLogcat()) {
|
||||||
|
Log.d(group.getTag(), String.format(messageString, args));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,6 +73,9 @@ public class ProtoLog {
|
|||||||
throw new UnsupportedOperationException(
|
throw new UnsupportedOperationException(
|
||||||
"ProtoLog calls MUST be processed with ProtoLogTool");
|
"ProtoLog calls MUST be processed with ProtoLogTool");
|
||||||
}
|
}
|
||||||
|
if (group.isLogToLogcat()) {
|
||||||
|
Log.v(group.getTag(), String.format(messageString, args));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,6 +91,9 @@ public class ProtoLog {
|
|||||||
throw new UnsupportedOperationException(
|
throw new UnsupportedOperationException(
|
||||||
"ProtoLog calls MUST be processed with ProtoLogTool");
|
"ProtoLog calls MUST be processed with ProtoLogTool");
|
||||||
}
|
}
|
||||||
|
if (group.isLogToLogcat()) {
|
||||||
|
Log.i(group.getTag(), String.format(messageString, args));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,6 +109,9 @@ public class ProtoLog {
|
|||||||
throw new UnsupportedOperationException(
|
throw new UnsupportedOperationException(
|
||||||
"ProtoLog calls MUST be processed with ProtoLogTool");
|
"ProtoLog calls MUST be processed with ProtoLogTool");
|
||||||
}
|
}
|
||||||
|
if (group.isLogToLogcat()) {
|
||||||
|
Log.w(group.getTag(), String.format(messageString, args));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,6 +127,9 @@ public class ProtoLog {
|
|||||||
throw new UnsupportedOperationException(
|
throw new UnsupportedOperationException(
|
||||||
"ProtoLog calls MUST be processed with ProtoLogTool");
|
"ProtoLog calls MUST be processed with ProtoLogTool");
|
||||||
}
|
}
|
||||||
|
if (group.isLogToLogcat()) {
|
||||||
|
Log.e(group.getTag(), String.format(messageString, args));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -128,5 +145,8 @@ public class ProtoLog {
|
|||||||
throw new UnsupportedOperationException(
|
throw new UnsupportedOperationException(
|
||||||
"ProtoLog calls MUST be processed with ProtoLogTool");
|
"ProtoLog calls MUST be processed with ProtoLogTool");
|
||||||
}
|
}
|
||||||
|
if (group.isLogToLogcat()) {
|
||||||
|
Log.wtf(group.getTag(), String.format(messageString, args));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ java_library_host {
|
|||||||
name: "protologtool-lib",
|
name: "protologtool-lib",
|
||||||
srcs: [
|
srcs: [
|
||||||
"src/com/android/protolog/tool/**/*.kt",
|
"src/com/android/protolog/tool/**/*.kt",
|
||||||
":protolog-common-src",
|
":protolog-common-no-android-src",
|
||||||
],
|
],
|
||||||
static_libs: [
|
static_libs: [
|
||||||
"javaparser",
|
"javaparser",
|
||||||
|
|||||||
Reference in New Issue
Block a user