log debug information for sensor threshold assert events
There are sightings that TCPUx_P12_PVCCIO_VS_Temp Sensor
reports reading of zero and trips the low critical threshold.
Add debug prints to gather data.
Also add logs for raw value in sensor base class to help
debug threshold assert events for other sensori type.
Tested:
Verified that log messages show up as expected for threshold
assert events. There is no unwanted log messages on systems that
do not have bad sensor readings.
Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Change-Id: Ib0557e804d275fbb3dce3347b4abec696925cc67
diff --git a/src/PSUSensor.cpp b/src/PSUSensor.cpp
index 6b27207..f93846d 100644
--- a/src/PSUSensor.cpp
+++ b/src/PSUSensor.cpp
@@ -143,9 +143,9 @@
try
{
std::getline(responseStream, response);
- double nvalue = std::stod(response);
+ rawValue = std::stod(response);
responseStream.clear();
- nvalue /= sensorFactor;
+ double nvalue = rawValue / sensorFactor;
updateValue(nvalue);
}