lg2: convert state-manager
This converts the rest of phosphor-state-manager over to the lg2
interface.
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I3878ec950b6a2b1ada93544cc021cecf14edfb46
diff --git a/settings.cpp b/settings.cpp
index 9a7879a..ff5d36f 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -3,12 +3,14 @@
#include "xyz/openbmc_project/Common/error.hpp"
#include <phosphor-logging/elog-errors.hpp>
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/lg2.hpp>
#include <sdbusplus/exception.hpp>
namespace settings
{
+PHOSPHOR_LOG2_USING;
+
using namespace phosphor::logging;
using namespace sdbusplus::xyz::openbmc_project::Common::Error;
@@ -38,14 +40,13 @@
response.read(result);
if (result.empty())
{
- log<level::ERR>("Invalid response from mapper");
+ error("Invalid response from mapper");
elog<InternalFailure>();
}
}
catch (const sdbusplus::exception::exception& e)
{
- log<level::ERR>("Error in mapper GetSubTree",
- entry("ERROR=%s", e.what()));
+ error("Error in mapper GetSubTree: {ERROR}", "ERROR", e);
elog<InternalFailure>();
}
@@ -113,14 +114,13 @@
}
catch (const sdbusplus::exception::exception& e)
{
- log<level::ERR>("Error in mapper GetObject",
- entry("ERROR=%s", e.what()));
+ error("Error in mapper GetObject: {ERROR}", "ERROR", e);
elog<InternalFailure>();
}
if (result.empty())
{
- log<level::ERR>("Invalid response from mapper");
+ error("Invalid response from mapper");
elog<InternalFailure>();
}