summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorVernon Mauery <vernon.mauery@linux.intel.com>2018-12-19 14:55:15 -0800
committerVernon Mauery <vernon.mauery@linux.intel.com>2018-12-19 15:40:27 -0800
commitfc37e59e2f85e585ee830e801b5b26a2c859c86b (patch)
tree860d6c1a630558246809c348682a889e26c52a14 /main.cpp
parent744b3c8b840a13ed4a6c07836ead4a0c88911437 (diff)
downloadphosphor-net-ipmid-fc37e59e2f85e585ee830e801b5b26a2c859c86b.tar.gz
phosphor-net-ipmid-fc37e59e2f85e585ee830e801b5b26a2c859c86b.zip
netipmid: replace std::cerr with phosphor::logging calls
This is part of a cleanup and standardization effort of code to get existing code up to date. Change-Id: I0c982ef8d7afa2f56a9cd204bb8ac3112769641c Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/main.cpp b/main.cpp
index c3f3dfd..abb7958 100644
--- a/main.cpp
+++ b/main.cpp
@@ -17,11 +17,13 @@
#include <systemd/sd-event.h>
#include <unistd.h>
-#include <iostream>
+#include <phosphor-logging/log.hpp>
#include <sdbusplus/asio/connection.hpp>
#include <sdbusplus/timer.hpp>
#include <tuple>
+using namespace phosphor::logging;
+
// Tuple of Global Singletons
static auto io = std::make_shared<boost::asio::io_context>();
session::Manager manager;
@@ -117,8 +119,8 @@ int main()
auto rc = sd_bus_default_system(&bus);
if (rc < 0)
{
- std::cerr << "Failed to connect to system bus:" << strerror(-rc)
- << "\n";
+ log<level::ERR>("Failed to connect to system bus",
+ entry("ERROR=%s", strerror(-rc)));
return rc;
}
@@ -126,7 +128,8 @@ int main()
rc = sd_event_default(&events);
if (rc < 0)
{
- std::cerr << "Failure to create sd_event" << strerror(-rc) << "\n";
+ log<level::ERR>("Failure to create sd_event",
+ entry("ERROR=%s", strerror(-rc)));
return EXIT_FAILURE;
}
sdbusp = std::make_shared<sdbusplus::asio::connection>(*io, bus);
OpenPOWER on IntegriCloud