remove phosphor-logging dependency
This commit removes pldm's dependency on phosphor-logging
and instead uses stdout and stdcerr for logging purpose.This is to
break the build time circular dependency between pldm and
phosphor-logging.
Change-Id: I8cffa3c99eb34efad5f186b3452a86ebadec2074
Signed-off-by: Sampa Misra <sampmisr@in.ibm.com>
diff --git a/libpldmresponder/utils.hpp b/libpldmresponder/utils.hpp
index f494291..453f6d9 100644
--- a/libpldmresponder/utils.hpp
+++ b/libpldmresponder/utils.hpp
@@ -5,11 +5,12 @@
#include <unistd.h>
#include <exception>
-#include <phosphor-logging/log.hpp>
+#include <iostream>
#include <sdbusplus/server.hpp>
#include <string>
#include <variant>
#include <vector>
+#include <xyz/openbmc_project/Logging/Entry/server.hpp>
#include "libpldm/base.h"
@@ -71,6 +72,12 @@
std::string getService(sdbusplus::bus::bus& bus, const std::string& path,
const std::string& interface);
+/**
+ * @brief creates an error log
+ * @param[in] errorMsg - the error message
+ */
+void reportError(const char* errorMsg);
+
/** @brief Convert any Decimal number to BCD
*
* @tparam[in] decimal - Decimal number
@@ -133,7 +140,6 @@
auto getDbusPropertyVariant(const char* objPath, const char* dbusProp,
const char* dbusInterface)
{
- using namespace phosphor::logging;
Variant value;
auto bus = sdbusplus::bus::new_default();
auto service = getService(bus, objPath, dbusInterface);
@@ -147,10 +153,10 @@
}
catch (const sdbusplus::exception::SdBusError& e)
{
- log<level::ERR>("dbus call expection", entry("OBJPATH=%s", objPath),
- entry("INTERFACE=%s", dbusInterface),
- entry("PROPERTY=%s", dbusProp),
- entry("EXPECTION=%s", e.what()));
+ std::cerr << "dbus call exception, OBJPATH=" << objPath
+ << " INTERFACE=" << dbusInterface
+ << " PROPERTY=" << dbusProp << " EXCEPTION=" << e.what()
+ << "\n";
}
return value;
}