logging: switch to lg2
After switching to C++20, it is recommended to use `phosphor::lg2`
to format log, and the correct `CODE_LINE` and `CODE_FUNC` values
can be used in log tracking.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I4aabaafe997e13c10d655a83a9ef0071ad11126e
diff --git a/command/sol_cmds.cpp b/command/sol_cmds.cpp
index 8203a6e..ceee3d8 100644
--- a/command/sol_cmds.cpp
+++ b/command/sol_cmds.cpp
@@ -4,7 +4,7 @@
#include "sol/sol_context.hpp"
#include "sol/sol_manager.hpp"
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/lg2.hpp>
namespace sol
{
@@ -43,7 +43,7 @@
}
catch (const std::exception& e)
{
- log<level::ERR>(e.what());
+ lg2::error("Failed to call the getContext method: {ERROR}", "ERROR", e);
return std::vector<uint8_t>();
}