Move phosphor-power-supply to lg2
Update the logging API used for files in phosphor-power-supply
from the older phosphor::logging::log style of journal traces
to the newer lg2::log style.
Tested:
* Verified journal traces worked correctly in simulation.
* Verified that formatting and key-value pairs for the
messages were correct via the journalctl command output.
Change-Id: Ib4c031be1e43a1726f8d22215fce2d4ccc330cfa
Signed-off-by: Anwaar Hadi <anwaar.hadi@ibm.com>
diff --git a/phosphor-power-supply/main.cpp b/phosphor-power-supply/main.cpp
index c48c73a..6d7c853 100644
--- a/phosphor-power-supply/main.cpp
+++ b/phosphor-power-supply/main.cpp
@@ -16,7 +16,7 @@
#include "psu_manager.hpp"
#include <CLI/CLI.hpp>
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/lg2.hpp>
#include <sdbusplus/bus.hpp>
#include <sdeventplus/event.hpp>
@@ -45,12 +45,12 @@
}
catch (const std::exception& e)
{
- log<level::ERR>(e.what());
+ lg2::error("Exception in main: {ERROR}", "ERROR", e);
return -2;
}
catch (...)
{
- log<level::ERR>("Caught unexpected exception type");
+ lg2::error("Caught unexpected exception type");
return -3;
}
}