convert systemintfcmds.cpp to use lg2
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I14a144cbb6482fdea655933af950eb38c083d7f5
diff --git a/systemintfcmds.cpp b/systemintfcmds.cpp
index fb5dde5..39ed323 100644
--- a/systemintfcmds.cpp
+++ b/systemintfcmds.cpp
@@ -8,6 +8,7 @@
#include <ipmid-host/cmd.hpp>
#include <ipmid/api.hpp>
#include <nlohmann/json.hpp>
+#include <phosphor-logging/lg2.hpp>
#include <cstring>
#include <fstream>
@@ -114,17 +115,15 @@
if (ipmi::getChannelInfo(ctx->channel, chInfo) != ipmi::ccSuccess)
{
- phosphor::logging::log<phosphor::logging::level::ERR>(
- "Failed to get Channel Info",
- phosphor::logging::entry("CHANNEL=%d", ctx->channel));
+ lg2::error("Failed to get Channel Info, channel={CHANNEL}", "CHANNEL",
+ ctx->channel);
return ipmi::responseUnspecifiedError();
}
if (chInfo.mediumType !=
static_cast<uint8_t>(ipmi::EChannelMediumType::systemInterface))
{
- phosphor::logging::log<phosphor::logging::level::ERR>(
- "Error - supported only in system interface");
+ lg2::error("Error - supported only in system interface");
return ipmi::responseCommandNotAvailable();
}