src: Convert logging to lg2
Change-Id: I28bf669e5139062f0f6145277db65d6821d48e78
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/src/FileHandle.cpp b/src/FileHandle.cpp
index 90bf64b..277a062 100644
--- a/src/FileHandle.cpp
+++ b/src/FileHandle.cpp
@@ -3,10 +3,11 @@
#include <fcntl.h>
#include <unistd.h>
+#include <phosphor-logging/lg2.hpp>
+
#include <filesystem>
#include <iostream>
#include <stdexcept>
-#include <string>
FileHandle::FileHandle(const std::filesystem::path& name,
std::ios_base::openmode mode) :
@@ -40,7 +41,7 @@
int r = close(fd);
if (r < 0)
{
- std::cerr << "Failed to close fd " << std::to_string(fd);
+ lg2::error("Failed to close fd: '{FD}'", "FD", fd);
}
}
}