sdr: Convert std::cerr to lg2
Change-Id: Ided5ac23f9b5a93e09928b324a5fc95ba689e874
Signed-off-by: Haicheng Zhang <zhanghch05@ieisystem.com>
diff --git a/dbus-sdr/storagecommands.cpp b/dbus-sdr/storagecommands.cpp
index 74ac3dd..856699b 100644
--- a/dbus-sdr/storagecommands.cpp
+++ b/dbus-sdr/storagecommands.cpp
@@ -34,7 +34,6 @@
#include <filesystem>
#include <fstream>
#include <functional>
-#include <iostream>
#include <optional>
#include <stdexcept>
#include <string_view>
@@ -1047,7 +1046,7 @@
}
catch (const std::invalid_argument&)
{
- std::cerr << "Invalid Generator ID\n";
+ lg2::error("Invalid Generator ID");
}
// Get the sensor type, sensor number, and event type for the sensor
@@ -1073,7 +1072,7 @@
}
catch (const std::invalid_argument&)
{
- std::cerr << "Invalid Event Direction\n";
+ lg2::error("Invalid Event Direction");
}
}
@@ -1188,7 +1187,7 @@
"xyz.openbmc_project.Logging.IPMI", "Clear");
if (ec)
{
- std::cerr << "error in clear SEL: " << ec.message() << std::endl;
+ lg2::error("error in clear SEL: {MSG}", "MSG", ec.message());
return ipmi::responseUnspecifiedError();
}