improve enum logging
Ensure we're using an enumeration string everywhere we log one to
improve readability of the log statements.
This depends on I6850b0bb142f0ef5219a5fc07c2cb4e2c90d5779 from
phosphor-logging for `to_string` conversion support.
Tested:
Running directly on development system shows:
```
<7> TYPE=CPU, NAME=CPU SUBTYPE=CPU PATH=, FREQ=1, WSIZE=120
<7> THRESHOLD TYPE=xyz.openbmc_project.Common.Threshold.Type.Warning THRESHOLD BOUND=xyz.openbmc_project.Common.Threshold.Bound.Upper VALUE=80.000000 LOG=False TARGET=
```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I5ea7a050e94833af272e79e6add716d1d3e66571
diff --git a/health_monitor.cpp b/health_monitor.cpp
index d0e3d4f..772bdf9 100644
--- a/health_monitor.cpp
+++ b/health_monitor.cpp
@@ -25,8 +25,7 @@
for (auto& [type, collectionConfig] : configs)
{
- info("Creating Health Metric Collection for {TYPE}", "TYPE",
- std::to_underlying(type));
+ info("Creating Health Metric Collection for {TYPE}", "TYPE", type);
collections[type] =
std::make_unique<CollectionIntf::HealthMetricCollection>(
ctx.get_bus(), type, collectionConfig, bmcPaths);
@@ -42,8 +41,7 @@
{
for (auto& [type, collection] : collections)
{
- debug("Reading Health Metric Collection for {TYPE}", "TYPE",
- std::to_underlying(type));
+ debug("Reading Health Metric Collection for {TYPE}", "TYPE", type);
collection->read();
}
co_await sdbusplus::async::sleep_for(ctx, std::chrono::seconds(1));