Move the control application to lg2
Update the logging API used for files in phosphor-fan-presence/control
from the older phosphor::logging::log to the more recent lg2::log.
Tested:
* Verified journal traces worked correctly in simulation.
* Modified json to force various property errors and verified
correct key/value pairs in the journalctl output.
Change-Id: If1ac33b90abe2a9baae6f3cc788863bd514fa80e
Signed-off-by: Anwaar Hadi <anwaar.hadi@ibm.com>
diff --git a/control/json/manager.hpp b/control/json/manager.hpp
index 5d94623..7e5d496 100644
--- a/control/json/manager.hpp
+++ b/control/json/manager.hpp
@@ -26,7 +26,7 @@
#include "zone.hpp"
#include <nlohmann/json.hpp>
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/lg2.hpp>
#include <sdbusplus/bus.hpp>
#include <sdbusplus/server/manager.hpp>
#include <sdeventplus/event.hpp>
@@ -46,7 +46,6 @@
{
using json = nlohmann::json;
-using namespace phosphor::logging;
/* Application name to be appended to the path for loading a JSON config file */
constexpr auto confAppName = "control";
@@ -242,10 +241,8 @@
std::make_pair(obj->getName(), obj->getProfiles()),
std::move(obj));
}
- log<level::INFO>(
- std::format("Configuration({}) loaded successfully",
- T::confFileName)
- .c_str());
+ lg2::info("Configuration({CONF_FILE}) loaded successfully",
+ "CONF_FILE", T::confFileName);
FlightRecorder::instance().log(
"main", std::format("Configuration({}) loaded successfully",
T::confFileName));