fan: Convert logging to lg2
Change-Id: I622dff33087039c460ce64ea06634a0e07555230
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/src/fan/TachSensor.cpp b/src/fan/TachSensor.cpp
index 10a34a4..c8a3c40 100644
--- a/src/fan/TachSensor.cpp
+++ b/src/fan/TachSensor.cpp
@@ -26,6 +26,7 @@
#include <boost/asio/error.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/random_access_file.hpp>
+#include <phosphor-logging/lg2.hpp>
#include <sdbusplus/asio/connection.hpp>
#include <sdbusplus/asio/object_server.hpp>
@@ -33,7 +34,6 @@
#include <chrono>
#include <cstddef>
#include <cstdint>
-#include <iostream>
#include <memory>
#include <optional>
#include <string>
@@ -151,7 +151,8 @@
if ((err == boost::system::errc::bad_file_descriptor) ||
(err == boost::asio::error::misc_errors::not_found))
{
- std::cerr << "TachSensor " << name << " removed " << path << "\n";
+ lg2::error("TachSensor '{NAME}' removed '{PATH}'", "NAME", name, "PATH",
+ path);
return; // we're being destroyed
}
bool missing = false;