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.

Tested: built phosphor-srvcfg-manager successfully and Unit Test
passes.

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ib676a0d8082b0e3e72b51bd5115bf5b05599e6ec
diff --git a/src/utils.cpp b/src/utils.cpp
index 908f34f..1ed4c1c 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -21,7 +21,7 @@
     if (ec)
     {
         std::string msgToLog = ec.message() + (msg.empty() ? "" : " - " + msg);
-        phosphor::logging::log<phosphor::logging::level::ERR>(msgToLog.c_str());
+        lg2::error("Check and throw internal failure: {MSG}", "MSG", msgToLog);
         phosphor::logging::elog<
             sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure>();
     }
@@ -44,8 +44,7 @@
     auto pos = path.rfind("/");
     if (pos == std::string::npos)
     {
-        phosphor::logging::log<phosphor::logging::level::ERR>(
-            "Unable to get job id from job path");
+        lg2::error("Unable to get job id from  {PATH}.", "PATH", path);
         phosphor::logging::elog<
             sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure>();
     }
@@ -80,8 +79,8 @@
                 // Queued job is done, return now
                 return;
             }
-            phosphor::logging::log<phosphor::logging::level::ERR>(
-                "Systemd operation failed for job query");
+            lg2::error("Systemd operation failed for job query: {EC}", "EC",
+                       ec.value());
             phosphor::logging::elog<sdbusplus::xyz::openbmc_project::Common::
                                         Error::InternalFailure>();
         }