logging: remove spaces in entry definition
phosphor-logging / journald does not allow a space in entry
headers. Change "FOO = %s" entry definitions to "FOO=%s".
Tested: After change observe logging entries using `journalctl
--output json-pretty` and see the FILENAME appear in an entry.
"FILENAME" : "/usr/share/phosphor-virtual-sensor/virtual_sensor_config.json",
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iff035554db5e65c54cceb23cf203d72872ad1455
diff --git a/virtualSensor.cpp b/virtualSensor.cpp
index 8b2792a..096845e 100644
--- a/virtualSensor.cpp
+++ b/virtualSensor.cpp
@@ -324,7 +324,7 @@
if (!jsonFile.is_open())
{
log<level::ERR>("config JSON file not found",
- entry("FILENAME = %s", configFile.c_str()));
+ entry("FILENAME=%s", configFile.c_str()));
throw std::exception{};
}
@@ -332,7 +332,7 @@
if (data.is_discarded())
{
log<level::ERR>("config readings JSON parser failure",
- entry("FILENAME = %s", configFile.c_str()));
+ entry("FILENAME=%s", configFile.c_str()));
throw std::exception{};
}
@@ -373,7 +373,7 @@
if (unitMap.find(sensorType) == unitMap.end())
{
log<level::ERR>("Sensor type is not supported",
- entry("TYPE = %s", sensorType.c_str()));
+ entry("TYPE=%s", sensorType.c_str()));
}
else
{
@@ -384,7 +384,7 @@
bus, objPath.c_str(), j, name);
log<level::INFO>("Added a new virtual sensor",
- entry("NAME = %s", name.c_str()));
+ entry("NAME=%s", name.c_str()));
virtualSensorPtr->updateVirtualSensor();
/* Initialize unit value for virtual sensor */