sensor-monitor/threshold_alarm_logger: Log sensor name
This patch introduces an optional feature to append the sensor name to
the error message description. This helps in identifying the specific
sensor that triggered the alarm, improving debugging and visibility.
Change-Id: I32942ab74ebdcf0675a35718a4140d221c3aa20a
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
diff --git a/sensor-monitor/threshold_alarm_logger.hpp b/sensor-monitor/threshold_alarm_logger.hpp
index 9524589..8b63360 100644
--- a/sensor-monitor/threshold_alarm_logger.hpp
+++ b/sensor-monitor/threshold_alarm_logger.hpp
@@ -157,6 +157,17 @@
std::string getSensorType(std::string sensorPath);
/**
+ * @brief Returns the name of the sensor using the path segment
+ *
+ * /xyz/openbmc_project/sensors/voltage/vout -> name == vout
+ *
+ * @param[in] sensorPath - The sensor object path name
+ *
+ * @return std::string The name segment
+ */
+ std::string getSensorName(const std::string& sensorPath);
+
+ /**
* @brief Allows for skipping event logs based on the sensor type.
*
* Specifically for the 'utilization' type because its provider