Correct message for threshold events
Thresholds can be deasserted not only because of the actual sensor
data, but also because of the change in the general system state.
For example some sensors can be configured to be measured only when
the system is powered on.
In such cases current messages can be confusing:
"PVPP_ABCD_CPU2 sensor crossed a critical low threshold going high.
Reading=0.033000 Threshold=2.410000".
Replace message template to be more generic to cover discussed cases:
"PVPP_ABCD_CPU2 critical low threshold deassert.
Reading=0.033000 Threshold=2.410000".
Change-Id: I875056c04bb2ff5e5dbcef10042a82c1ca06de5f
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
diff --git a/include/threshold_event_monitor.hpp b/include/threshold_event_monitor.hpp
index 5b79a7a..cea25c1 100644
--- a/include/threshold_event_monitor.hpp
+++ b/include/threshold_event_monitor.hpp
@@ -277,11 +277,11 @@
}
}
- std::string journalMsg(std::string(sensorName) + " sensor crossed a " +
- threshold + " threshold going " + direction +
- ". Reading=" + std::to_string(assertValue) +
- " Threshold=" + std::to_string(thresholdVal) +
- ".");
+ std::string journalMsg(
+ std::string(sensorName) + " " + threshold + " threshold " +
+ (assert ? "assert" : "deassert") +
+ ". Reading=" + std::to_string(assertValue) +
+ " Threshold=" + std::to_string(thresholdVal) + ".");
#ifdef SEL_LOGGER_SEND_TO_LOGGING_SERVICE
std::string LogLevel = "";