log consistently via stderr
Most log messages in this codebase use stderr, while a few used
phosphor-logging. Transition all to use stderr.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ic4cf619950275a2752f646f00974047092757010
diff --git a/bmc/buildjson.cpp b/bmc/buildjson.cpp
index 822e640..d1bb3de 100644
--- a/bmc/buildjson.cpp
+++ b/bmc/buildjson.cpp
@@ -192,8 +192,6 @@
std::vector<HandlerConfig> BuildHandlerConfigs(const std::string& directory)
{
- using namespace phosphor::logging;
-
std::vector<HandlerConfig> output;
std::vector<std::string> jsonPaths = GetJsonList(directory);
@@ -203,17 +201,15 @@
std::ifstream jsonFile(path);
if (!jsonFile.is_open())
{
- log<level::ERR>("Unable to open json file",
- entry("PATH=%s", path.c_str()));
+ std::fprintf(stderr, "Unable to open json file: %s\n",
+ path.c_str());
continue;
}
auto data = nlohmann::json::parse(jsonFile, nullptr, false);
if (data.is_discarded())
{
- log<level::ERR>("Parsing json failed",
- entry("PATH=%s", path.c_str()));
- continue;
+ std::fprintf(stderr, "Parsing json failed: %s\n", path.c_str());
}
std::vector<HandlerConfig> configs = buildHandlerFromJson(data);
diff --git a/bmc/firmware_handler.cpp b/bmc/firmware_handler.cpp
index 9923d5b..917dbc4 100644
--- a/bmc/firmware_handler.cpp
+++ b/bmc/firmware_handler.cpp
@@ -33,8 +33,6 @@
#include <string>
#include <vector>
-using namespace phosphor::logging;
-
namespace ipmi_flash
{
@@ -46,7 +44,7 @@
/* There must be at least one in addition to the hash blob handler. */
if (firmwares.size() < 2)
{
- log<level::ERR>("Must provide at least two firmware handlers.");
+ std::fprintf(stderr, "Must provide at least two firmware handlers.");
return nullptr;
}
if (transports.empty())
diff --git a/bmc/main.cpp b/bmc/main.cpp
index 48af9d0..f9b1d7a 100644
--- a/bmc/main.cpp
+++ b/bmc/main.cpp
@@ -138,9 +138,7 @@
if (!handler)
{
- using namespace phosphor::logging;
-
- log<level::ERR>("Firmware Handler has invalid configuration");
+ std::fprintf(stderr, "Firmware Handler has an invalid configuration");
return nullptr;
}
diff --git a/cleanup/main.cpp b/cleanup/main.cpp
index 09bdb72..91e7297 100644
--- a/cleanup/main.cpp
+++ b/cleanup/main.cpp
@@ -35,14 +35,12 @@
extern "C" std::unique_ptr<blobs::GenericBlobInterface> createHandler()
{
- using namespace phosphor::logging;
-
auto handler = ipmi_flash::FileCleanupHandler::CreateCleanupHandler(
ipmi_flash::cleanupBlobId, ipmi_flash::files);
if (!handler)
{
- log<level::ERR>("Unable to create FileCleanupHandle for Firmware");
+ std::fprintf(stderr, "Unable to create FileCleanupHandle for Firmware");
return nullptr;
}
diff --git a/configure.ac b/configure.ac
index 4863dc1..41dd7f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,8 +77,6 @@
[AC_MSG_ERROR([The openbmc/sdbusplus package is required])]
)
- PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
-
AC_CHECK_HEADER(
[blobs-ipmid/blobs.hpp],
[],