summaryrefslogtreecommitdiff
path: root/startop/iorap
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2020-10-09 11:14:30 -0700
committerXin Li <delphij@google.com>2020-10-10 20:38:57 -0700
commit986e6eeddf02959975e63a7cd138e70784540bf6 (patch)
treebf060846893c657436f9429650f2240f048dd0be /startop/iorap
parent1015bae311220fe8242c33e58e11a932ed6f8a3a (diff)
parent539d92beb7ed3638107c6d90c2f6a2e8a891256d (diff)
Merge ab/6749736 in stage.
Bug: 167233921 Merged-In: Iecef31f7bf10ad97b7e0075cf302ae94e248474a Change-Id: I9e9c873bc2e05a0cfe3af0bf74725500f3f108db
Diffstat (limited to 'startop/iorap')
-rw-r--r--startop/iorap/src/com/google/android/startop/iorap/EventSequenceValidator.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/startop/iorap/src/com/google/android/startop/iorap/EventSequenceValidator.java b/startop/iorap/src/com/google/android/startop/iorap/EventSequenceValidator.java
index 67e1b440e28a..9b7a62b3a1df 100644
--- a/startop/iorap/src/com/google/android/startop/iorap/EventSequenceValidator.java
+++ b/startop/iorap/src/com/google/android/startop/iorap/EventSequenceValidator.java
@@ -96,7 +96,8 @@ import java.io.PrintWriter;
*/
public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
static final String TAG = "EventSequenceValidator";
-
+ /** $> adb shell 'setprop log.tag.EventSequenceValidator VERBOSE' */
+ public static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
private State state = State.INIT;
private long accIntentStartedEvents = 0;
@@ -255,9 +256,11 @@ public class EventSequenceValidator implements ActivityMetricsLaunchObserver {
}
private void logWarningWithStackTrace(String log) {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- new Throwable("EventSequenceValidator#getStackTrace").printStackTrace(pw);
- Log.d(TAG, String.format("%s\n%s", log, sw));
+ if (DEBUG) {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ new Throwable("EventSequenceValidator#getStackTrace").printStackTrace(pw);
+ Log.wtf(TAG, String.format("%s\n%s", log, sw));
+ }
}
}