Add basic logging infrastructure for bugreports

Test: as follows
    - built, flashed, booted
    - "adb shell dumpsys netd" shows logs
    - tests/runtests.sh passes
Change-Id: I0e44da7f9a9cc53074ffc396b958e9e2dbcd2603
diff --git a/server/TrafficController.cpp b/server/TrafficController.cpp
index ffbc363..4426e58 100644
--- a/server/TrafficController.cpp
+++ b/server/TrafficController.cpp
@@ -636,8 +636,8 @@
 void dumpBpfMap(const std::string& mapName, DumpWriter& dw, const std::string& header) {
     dw.blankline();
     dw.println("%s:", mapName.c_str());
-    if(!header.empty()) {
-        dw.println(header.c_str());
+    if (!header.empty()) {
+        dw.println(header);
     }
 }
 
@@ -645,14 +645,15 @@
 
 void TrafficController::dump(DumpWriter& dw, bool verbose) {
     std::lock_guard<std::mutex> ownerMapGuard(mOwnerMatchMutex);
-    dw.incIndent();
+    ScopedIndent indentTop(dw);
     dw.println("TrafficController");
 
-    dw.incIndent();
+    ScopedIndent indentPreBpfModule(dw);
     dw.println("BPF module status: %s", ebpfSupported? "ON" : "OFF");
 
-    if (!ebpfSupported)
+    if (!ebpfSupported) {
         return;
+    }
 
     dw.blankline();
     dw.println("mCookieTagMap status: %s",
@@ -691,12 +692,14 @@
     dw.println("xt_bpf bandwidth blacklist program status: %s",
                getProgramStatus(XT_BPF_BLACKLIST_PROG_PATH).c_str());
 
-    if(!verbose) return;
+    if (!verbose) {
+        return;
+    }
 
     dw.blankline();
     dw.println("BPF map content:");
 
-    dw.incIndent();
+    ScopedIndent indentForMapContent(dw);
 
     // Print CookieTagMap content.
     dumpBpfMap("mCookieTagMap", dw, "");
@@ -820,12 +823,6 @@
     if (!isOk(res)) {
         dw.println("mBandwidthUidMap print end with error: %s", res.msg().c_str());
     }
-    dw.decIndent();
-
-    dw.decIndent();
-
-    dw.decIndent();
-
 }
 
 }  // namespace net