Fix anomaly is not logged in non-debug mode.

Proto is not supported to fully toString() in non-debug mode.

Bug: 327978756
Fix: 327978756
Test: manual
Change-Id: I1231c40769fd345b500ec120cf9c6fca3eb7c54a
diff --git a/src/com/android/settings/fuelgauge/batteryusage/PowerUsageAdvanced.java b/src/com/android/settings/fuelgauge/batteryusage/PowerUsageAdvanced.java
index 1482117..29839e9 100644
--- a/src/com/android/settings/fuelgauge/batteryusage/PowerUsageAdvanced.java
+++ b/src/com/android/settings/fuelgauge/batteryusage/PowerUsageAdvanced.java
@@ -274,8 +274,7 @@
         if (!isResumed() || anomalyEventList == null) {
             return;
         }
-        Log.d(TAG, "anomalyEventList = " + anomalyEventList);
-
+        logPowerAnomalyEventList(anomalyEventList);
         final Set<String> dismissedPowerAnomalyKeys =
                 DatabaseUtils.getDismissedPowerAnomalyKeys(getContext());
         Log.d(TAG, "dismissedPowerAnomalyKeys = " + dismissedPowerAnomalyKeys);
@@ -429,10 +428,19 @@
                         .filter(predicate)
                         .max(Comparator.comparing(PowerAnomalyEvent::getScore))
                         .orElse(null);
-        Log.d(TAG, "filterAnomalyEvent = " + filterAnomalyEvent);
+        Log.d(TAG, "filterAnomalyEvent = "
+                + (filterAnomalyEvent == null ? null : filterAnomalyEvent.getEventId()));
         return filterAnomalyEvent;
     }
 
+    private static void logPowerAnomalyEventList(PowerAnomalyEventList anomalyEventList) {
+        final StringBuilder stringBuilder = new StringBuilder();
+        for (PowerAnomalyEvent anomalyEvent : anomalyEventList.getPowerAnomalyEventsList()) {
+            stringBuilder.append(anomalyEvent.getEventId()).append(", ");
+        }
+        Log.d(TAG, "anomalyEventList = [" + stringBuilder + "]");
+    }
+
     private static BatteryDiffData getAllBatteryDiffData(
             Map<Integer, Map<Integer, BatteryDiffData>> batteryUsageMap) {
         return batteryUsageMap == null