json config: Trace when conf files can't be found
Add a trace to the journal when the IBMCompatibleSystem interface is
available but the JSON configuration file being looked for still can't
be found.
This would indicate someone hasn't yet put the fan config files in the
driver for a particular system type.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I3caa223d8b5d56bfb903c7de06cdd3bc95a4b81a
diff --git a/json_config.hpp b/json_config.hpp
index d2215ca..ea79570 100644
--- a/json_config.hpp
+++ b/json_config.hpp
@@ -133,6 +133,13 @@
_readyFunc(_confFile);
_match.reset();
}
+ else
+ {
+ log<level::ERR>(fmt::format("Could not find fan {} conf file {} "
+ "even after {} iface became available",
+ _appName, _fileName, confCompatIntf)
+ .c_str());
+ }
}
/**
@@ -210,6 +217,13 @@
}
}
+ if (!isOptional && confFile.empty() && !objects.empty())
+ {
+ log<level::ERR>(fmt::format("Could not find fan {} conf file {}",
+ appName, fileName)
+ .c_str());
+ }
+
if (confFile.empty() && !isOptional)
{
throw std::runtime_error("No JSON config file found");