intel-cpu: Convert logging to lg2
Change-Id: I54869ba638de055e2f115b90c05e0f90354c3980
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/src/intel-cpu/IntelCPUSensor.hpp b/src/intel-cpu/IntelCPUSensor.hpp
index 73a9f01..f51158b 100644
--- a/src/intel-cpu/IntelCPUSensor.hpp
+++ b/src/intel-cpu/IntelCPUSensor.hpp
@@ -9,13 +9,13 @@
#include <boost/asio/streambuf.hpp>
#include <boost/container/flat_map.hpp>
#include <gpiod.hpp>
+#include <phosphor-logging/lg2.hpp>
#include <sdbusplus/asio/connection.hpp>
#include <sdbusplus/asio/object_server.hpp>
#include <sensor.hpp>
#include <cstddef>
#include <cstdint>
-#include <iostream>
#include <memory>
#include <string>
#include <system_error>
@@ -98,7 +98,7 @@
auto line = gpiod::find_line(gpioName);
if (!line)
{
- std::cerr << "Error requesting gpio: " << gpioName << "\n";
+ lg2::error("Error requesting gpio: '{NAME}'", "NAME", gpioName);
return false;
}
@@ -111,7 +111,7 @@
}
catch (const std::system_error&)
{
- std::cerr << "Error reading gpio: " << gpioName << "\n";
+ lg2::error("Error reading gpio: '{NAME}'", "NAME", gpioName);
return false;
}