Print the failing filename in the journal msg
Instead of hiding the name of the file that had the failed access in the
journal metadata, put it in the journal message so debug is easier.
Uses the fmt library.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ice3958ffb576adf0b06ef7eab7d2fc03aa526819
diff --git a/sensor.cpp b/sensor.cpp
index 145ba6c..1c91c1e 100644
--- a/sensor.cpp
+++ b/sensor.cpp
@@ -8,6 +8,8 @@
#include "sensorset.hpp"
#include "sysfs.hpp"
+#include <fmt/format.h>
+
#include <cassert>
#include <chrono>
#include <cmath>
@@ -243,8 +245,7 @@
metadata::CALLOUT_DEVICE_PATH(_devPath.c_str()));
log<level::INFO>(
- "Logging failing sysfs file",
- phosphor::logging::entry("FILE=%s", sysfsFullPath.c_str()));
+ fmt::format("Failing sysfs file: {}", sysfsFullPath).c_str());
}
}