diff options
Diffstat (limited to 'startop')
-rw-r--r-- | startop/iorap/src/com/google/android/startop/iorap/EventSequenceValidator.java | 13 |
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)); + } } } |