control: Log target changes in flight recorder
With this there will be a history of how the fans were changing over
time. There's a 20 entry limit in the flight recorder so it will always
just show the 20 latest target changes.
Example:
zone-set-target0: Set target 10500 (from 11300)"
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I93b55eea5ef288bc069eb6c29a15770165067848
diff --git a/control/json/zone.cpp b/control/json/zone.cpp
index f484733..aa81d58 100644
--- a/control/json/zone.cpp
+++ b/control/json/zone.cpp
@@ -145,6 +145,12 @@
{
if (_isActive)
{
+ if (_target != target)
+ {
+ FlightRecorder::instance().log(
+ "zone-set-target" + getName(),
+ fmt::format("Set target {} (from {})", target, _target));
+ }
_target = target;
for (auto& fan : _fans)
{