pid: added thermal inputs & failsafe to logging

The tuning logging now includes the thermal inputs and whether
the zone is in failsafe mode.

Tested: Ran on quanta-q71l and verified the log looked correct.
Change-Id: I2ee8d3128d7d969e63cb6b8728dc6698a4f54aae
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/pid/zone.cpp b/pid/zone.cpp
index 04b3176..393f6e6 100644
--- a/pid/zone.cpp
+++ b/pid/zone.cpp
@@ -158,7 +158,9 @@
 #ifdef __TUNING_LOGGING__
 void PIDZone::initializeLog(void)
 {
-    /* Print header for log file. */
+    /* Print header for log file:
+     * epoch_ms,setpt,fan1,fan2,fanN,sensor1,sensor2,sensorN,failsafe
+     */
 
     _log << "epoch_ms,setpt";
 
@@ -166,6 +168,11 @@
     {
         _log << "," << f;
     }
+    for (auto& t : _thermalInputs)
+    {
+        _log << "," << t;
+    }
+    _log << ",failsafe";
     _log << std::endl;
 
     return;
@@ -218,6 +225,13 @@
 #endif
     }
 
+#ifdef __TUNING_LOGGING__
+    for (auto& t : _thermalInputs)
+    {
+        _log << "," << _cachedValuesByName[t];
+    }
+#endif
+
     return;
 }