By default, rich events have log level VERBOSE
So that on debuggable devices, we'll see SysuiLogs in
logcat for events logged that don't specify their log level
For logcat logs, don't include the timestamp
Test: manual
Change-Id: If2cb238e70acc5a551d4b4a4161dc0020536cec9
diff --git a/packages/SystemUI/src/com/android/systemui/log/RichEvent.java b/packages/SystemUI/src/com/android/systemui/log/RichEvent.java
index 89b7a818..acf761ed 100644
--- a/packages/SystemUI/src/com/android/systemui/log/RichEvent.java
+++ b/packages/SystemUI/src/com/android/systemui/log/RichEvent.java
@@ -67,7 +67,7 @@
private B mBuilder = getBuilder();
protected int mType = UNINITIALIZED;
protected String mReason;
- protected @Level int mLogLevel;
+ protected @Level int mLogLevel = VERBOSE;
/**
* Get the log-specific builder.
diff --git a/packages/SystemUI/src/com/android/systemui/log/SysuiLog.java b/packages/SystemUI/src/com/android/systemui/log/SysuiLog.java
index a6e10e6..f094cb9 100644
--- a/packages/SystemUI/src/com/android/systemui/log/SysuiLog.java
+++ b/packages/SystemUI/src/com/android/systemui/log/SysuiLog.java
@@ -120,9 +120,9 @@
}
/**
- * @return user-readable string of the given event
+ * @return user-readable string of the given event with timestamp
*/
- public String eventToString(Event event) {
+ public String eventToTimestampedString(Event event) {
StringBuilder sb = new StringBuilder();
sb.append(SysuiLog.DATE_FORMAT.format(event.getTimestamp()));
sb.append(" ");
@@ -131,13 +131,20 @@
}
/**
+ * @return user-readable string of the given event without a timestamp
+ */
+ public String eventToString(Event event) {
+ return event.getMessage();
+ }
+
+ /**
* only call on this method if you have the mDataLock
*/
private void dumpTimelineLocked(PrintWriter pw) {
pw.println("\tTimeline:");
for (Event event : mTimeline) {
- pw.println("\t" + eventToString(event));
+ pw.println("\t" + eventToTimestampedString(event));
}
}