Add more statsd's debugging info to dumpsys.

+ Bugreport will use the non-verbose mode
+ Reuse the log_msg object in LogReader
+ Add logd errors to StatsdStats

Bug: 72383073

Test: manual + statsd_test

Change-Id: Id5a8b103074d034f5ece3c9831c740d44a5df9cd
diff --git a/cmds/statsd/src/metrics/MetricProducer.h b/cmds/statsd/src/metrics/MetricProducer.h
index 3779c44..6f33073 100644
--- a/cmds/statsd/src/metrics/MetricProducer.h
+++ b/cmds/statsd/src/metrics/MetricProducer.h
@@ -96,6 +96,11 @@
         return onDumpReportLocked(dumpTimeNs, report);
     }
 
+    void dumpStates(FILE* out, bool verbose) const {
+        std::lock_guard<std::mutex> lock(mMutex);
+        dumpStatesLocked(out, verbose);
+    }
+
     // Returns the memory in bytes currently used to store this metric's data. Does not change
     // state.
     size_t byteSize() const {
@@ -128,6 +133,7 @@
                                     android::util::ProtoOutputStream* protoOutput) = 0;
     virtual void onDumpReportLocked(const uint64_t dumpTimeNs, StatsLogReport* report) = 0;
     virtual size_t byteSizeLocked() const = 0;
+    virtual void dumpStatesLocked(FILE* out, bool verbose) const = 0;
 
     const int64_t mMetricId;