Replace logging with std::format

std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.

Unfortunately, given its level of compile time checks, it needs to be a
method, instead of the stream style logging we had before.  This
requires a pretty substantial change.  Fortunately, this change can be
largely automated, via the script included in this commit under
scripts/replace_logs.py.  This is to aid people in moving their
patchsets over to the new form in the short period where old patches
will be based on the old logging.  The intention is that this script
eventually goes away.

The old style logging (stream based) looked like.

BMCWEB_LOG_DEBUG << "Foo " << foo;

The new equivalent of the above would be:
BMCWEB_LOG_DEBUG("Foo {}", foo);

In the course of doing this, this also cleans up several ignored linter
errors, including macro usage, and array to pointer deconstruction.

Note, This patchset does remove the timestamp from the log message.  In
practice, this was duplicated between journald and bmcweb, and there's
no need for both to exist.

One design decision of note is the addition of logPtr.  Because the
compiler can't disambiguate between const char* and const MyThing*, it's
necessary to add an explicit cast to void*.  This is identical to how
fmt handled it.

Tested:  compiled with logging meson_option enabled, and launched bmcweb

Saw the usual logging, similar to what was present before:
```
[Error include/webassets.hpp:60] Unable to find or open /usr/share/www/ static file hosting disabled
[Debug include/persistent_data.hpp:133] Restored Session Timeout: 1800
[Debug redfish-core/include/event_service_manager.hpp:671] Old eventService config not exist
[Info src/webserver_main.cpp:59] Starting webserver on port 18080
[Error redfish-core/include/event_service_manager.hpp:1301] inotify_add_watch failed for redfish log file.
[Info src/webserver_main.cpp:137] Start Hostname Monitor Service...
```
Signed-off-by: Ed Tanous <ed@tanous.net>

Change-Id: I86a46aa2454be7fe80df608cb7e5573ca4029ec8
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index 357c047..3e75425 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -63,7 +63,7 @@
 inline static void activateImage(const std::string& objPath,
                                  const std::string& service)
 {
-    BMCWEB_LOG_DEBUG << "Activate image for " << objPath << " " << service;
+    BMCWEB_LOG_DEBUG("Activate image for {} {}", objPath, service);
     sdbusplus::asio::setProperty(
         *crow::connections::systemBus, service, objPath,
         "xyz.openbmc_project.Software.Activation", "RequestedActivation",
@@ -71,8 +71,8 @@
         [](const boost::system::error_code& ec) {
         if (ec)
         {
-            BMCWEB_LOG_DEBUG << "error_code = " << ec;
-            BMCWEB_LOG_DEBUG << "error msg = " << ec.message();
+            BMCWEB_LOG_DEBUG("error_code = {}", ec);
+            BMCWEB_LOG_DEBUG("error msg = {}", ec.message());
         }
         });
 }
@@ -89,10 +89,10 @@
 
     m.read(objPath, interfacesProperties);
 
-    BMCWEB_LOG_DEBUG << "obj path = " << objPath.str;
+    BMCWEB_LOG_DEBUG("obj path = {}", objPath.str);
     for (const auto& interface : interfacesProperties)
     {
-        BMCWEB_LOG_DEBUG << "interface = " << interface.first;
+        BMCWEB_LOG_DEBUG("interface = {}", interface.first);
 
         if (interface.first == "xyz.openbmc_project.Software.Activation")
         {
@@ -108,8 +108,8 @@
                         objInfo) mutable {
                 if (ec)
                 {
-                    BMCWEB_LOG_DEBUG << "error_code = " << ec;
-                    BMCWEB_LOG_DEBUG << "error msg = " << ec.message();
+                    BMCWEB_LOG_DEBUG("error_code = {}", ec);
+                    BMCWEB_LOG_DEBUG("error msg = {}", ec.message());
                     if (asyncResp)
                     {
                         messages::internalError(asyncResp->res);
@@ -120,8 +120,7 @@
                 // Ensure we only got one service back
                 if (objInfo.size() != 1)
                 {
-                    BMCWEB_LOG_ERROR << "Invalid Object Size "
-                                     << objInfo.size();
+                    BMCWEB_LOG_ERROR("Invalid Object Size {}", objInfo.size());
                     if (asyncResp)
                     {
                         messages::internalError(asyncResp->res);
@@ -295,12 +294,11 @@
             // expected, we were canceled before the timer completed.
             return;
         }
-        BMCWEB_LOG_ERROR
-            << "Timed out waiting for firmware object being created";
-        BMCWEB_LOG_ERROR << "FW image may has already been uploaded to server";
+        BMCWEB_LOG_ERROR("Timed out waiting for firmware object being created");
+        BMCWEB_LOG_ERROR("FW image may has already been uploaded to server");
         if (ec)
         {
-            BMCWEB_LOG_ERROR << "Async_wait failed" << ec;
+            BMCWEB_LOG_ERROR("Async_wait failed{}", ec);
             return;
         }
         if (asyncResp)
@@ -310,7 +308,7 @@
     });
     task::Payload payload(req);
     auto callback = [asyncResp, payload](sdbusplus::message_t& m) mutable {
-        BMCWEB_LOG_DEBUG << "Match fired";
+        BMCWEB_LOG_DEBUG("Match fired");
         softwareInterfaceAdded(asyncResp, m, std::move(payload));
     };
 
@@ -332,7 +330,7 @@
             interfacesProperties;
         sdbusplus::message::object_path objPath;
         m.read(objPath, interfacesProperties);
-        BMCWEB_LOG_DEBUG << "obj path = " << objPath.str;
+        BMCWEB_LOG_DEBUG("obj path = {}", objPath.str);
         for (const std::pair<std::string, dbus::utility::DBusPropertiesMap>&
                  interface : interfacesProperties)
         {
@@ -423,7 +421,7 @@
         std::optional<std::string> transferProtocol;
         std::string imageURI;
 
-        BMCWEB_LOG_DEBUG << "Enter UpdateService.SimpleUpdate doPost";
+        BMCWEB_LOG_DEBUG("Enter UpdateService.SimpleUpdate doPost");
 
         // User can pass in both TransferProtocol and ImageURI parameters or
         // they can pass in just the ImageURI with the transfer protocol
@@ -434,8 +432,7 @@
         if (!json_util::readJsonAction(req, asyncResp->res, "TransferProtocol",
                                        transferProtocol, "ImageURI", imageURI))
         {
-            BMCWEB_LOG_DEBUG
-                << "Missing TransferProtocol or ImageURI parameter";
+            BMCWEB_LOG_DEBUG("Missing TransferProtocol or ImageURI parameter");
             return;
         }
         if (!transferProtocol)
@@ -449,22 +446,21 @@
                 messages::actionParameterValueTypeError(
                     asyncResp->res, imageURI, "ImageURI",
                     "UpdateService.SimpleUpdate");
-                BMCWEB_LOG_ERROR << "ImageURI missing transfer protocol: "
-                                 << imageURI;
+                BMCWEB_LOG_ERROR("ImageURI missing transfer protocol: {}",
+                                 imageURI);
                 return;
             }
             transferProtocol = imageURI.substr(0, separator);
             // Ensure protocol is upper case for a common comparison path
             // below
             boost::to_upper(*transferProtocol);
-            BMCWEB_LOG_DEBUG << "Encoded transfer protocol "
-                             << *transferProtocol;
+            BMCWEB_LOG_DEBUG("Encoded transfer protocol {}", *transferProtocol);
 
             // Adjust imageURI to not have the protocol on it for parsing
             // below
             // ex. tftp://1.1.1.1/myfile.bin -> 1.1.1.1/myfile.bin
             imageURI = imageURI.substr(separator + 3);
-            BMCWEB_LOG_DEBUG << "Adjusted imageUri " << imageURI;
+            BMCWEB_LOG_DEBUG("Adjusted imageUri {}", imageURI);
         }
 
         // OpenBMC currently only supports TFTP
@@ -473,8 +469,8 @@
             messages::actionParameterNotSupported(asyncResp->res,
                                                   "TransferProtocol",
                                                   "UpdateService.SimpleUpdate");
-            BMCWEB_LOG_ERROR << "Request incorrect protocol parameter: "
-                             << *transferProtocol;
+            BMCWEB_LOG_ERROR("Request incorrect protocol parameter: {}",
+                             *transferProtocol);
             return;
         }
 
@@ -486,13 +482,13 @@
             messages::actionParameterValueTypeError(
                 asyncResp->res, imageURI, "ImageURI",
                 "UpdateService.SimpleUpdate");
-            BMCWEB_LOG_ERROR << "Invalid ImageURI: " << imageURI;
+            BMCWEB_LOG_ERROR("Invalid ImageURI: {}", imageURI);
             return;
         }
 
         std::string tftpServer = imageURI.substr(0, separator);
         std::string fwFile = imageURI.substr(separator + 1);
-        BMCWEB_LOG_DEBUG << "Server: " << tftpServer + " File: " << fwFile;
+        BMCWEB_LOG_DEBUG("Server: {}{}", tftpServer + " File: ", fwFile);
 
         // Setup callback for when new software detected
         // Give TFTP 10 minutes to complete
@@ -514,19 +510,19 @@
             {
                 // messages::internalError(asyncResp->res);
                 cleanUp();
-                BMCWEB_LOG_DEBUG << "error_code = " << ec;
-                BMCWEB_LOG_DEBUG << "error msg = " << ec.message();
+                BMCWEB_LOG_DEBUG("error_code = {}", ec);
+                BMCWEB_LOG_DEBUG("error msg = {}", ec.message());
             }
             else
             {
-                BMCWEB_LOG_DEBUG << "Call to DownloaViaTFTP Success";
+                BMCWEB_LOG_DEBUG("Call to DownloaViaTFTP Success");
             }
             },
             "xyz.openbmc_project.Software.Download",
             "/xyz/openbmc_project/software", "xyz.openbmc_project.Common.TFTP",
             "DownloadViaTFTP", fwFile, tftpServer);
 
-        BMCWEB_LOG_DEBUG << "Exit UpdateService.SimpleUpdate doPost";
+        BMCWEB_LOG_DEBUG("Exit UpdateService.SimpleUpdate doPost");
         });
 }
 
@@ -534,7 +530,7 @@
 {
     std::filesystem::path filepath("/tmp/images/" + bmcweb::getRandomUUID());
 
-    BMCWEB_LOG_DEBUG << "Writing file to " << filepath;
+    BMCWEB_LOG_DEBUG("Writing file to {}", filepath.string());
     std::ofstream out(filepath, std::ofstream::out | std::ofstream::binary |
                                     std::ofstream::trunc);
     // set the permission of the file to 640
@@ -566,8 +562,8 @@
     }
     else
     {
-        BMCWEB_LOG_INFO
-            << "ApplyTime value is not in the list of acceptable values";
+        BMCWEB_LOG_INFO(
+            "ApplyTime value is not in the list of acceptable values");
         messages::propertyValueNotInList(asyncResp->res, applyTime,
                                          "ApplyTime");
         return;
@@ -581,7 +577,7 @@
         applyTimeNewVal, [asyncResp](const boost::system::error_code& ec) {
             if (ec)
             {
-                BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec;
+                BMCWEB_LOG_ERROR("D-Bus responses error: {}", ec);
                 messages::internalError(asyncResp->res);
                 return;
             }
@@ -602,10 +598,10 @@
             formpart.fields.find("Content-Disposition");
         if (it == formpart.fields.end())
         {
-            BMCWEB_LOG_ERROR << "Couldn't find Content-Disposition";
+            BMCWEB_LOG_ERROR("Couldn't find Content-Disposition");
             return;
         }
-        BMCWEB_LOG_INFO << "Parsing value " << it->value();
+        BMCWEB_LOG_INFO("Parsing value {}", it->value());
 
         // The construction parameters of param_list must start with `;`
         size_t index = it->value().find(';');
@@ -656,7 +652,7 @@
 
     if (uploadData == nullptr)
     {
-        BMCWEB_LOG_ERROR << "Upload data is NULL";
+        BMCWEB_LOG_ERROR("Upload data is NULL");
         messages::propertyMissing(asyncResp->res, "UpdateFile");
         return;
     }
@@ -681,7 +677,7 @@
     }
     std::string_view contentType = req.getHeaderValue("Content-Type");
 
-    BMCWEB_LOG_DEBUG << "doPost: contentType=" << contentType;
+    BMCWEB_LOG_DEBUG("doPost: contentType={}", contentType);
 
     // Make sure that content type is application/octet-stream or
     // multipart/form-data
@@ -705,8 +701,8 @@
         if (ec != ParserError::PARSER_SUCCESS)
         {
             // handle error
-            BMCWEB_LOG_ERROR << "MIME parse failed, ec : "
-                             << static_cast<int>(ec);
+            BMCWEB_LOG_ERROR("MIME parse failed, ec : {}",
+                             static_cast<int>(ec));
             messages::internalError(asyncResp->res);
             return;
         }
@@ -714,7 +710,7 @@
     }
     else
     {
-        BMCWEB_LOG_DEBUG << "Bad content type specified:" << contentType;
+        BMCWEB_LOG_DEBUG("Bad content type specified:{}", contentType);
         asyncResp->res.result(boost::beast::http::status::bad_request);
     }
 }
@@ -768,7 +764,7 @@
                         const std::string& applyTime) {
             if (ec)
             {
-                BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+                BMCWEB_LOG_DEBUG("DBUS response error {}", ec);
                 messages::internalError(asyncResp->res);
                 return;
             }
@@ -799,7 +795,7 @@
         {
             return;
         }
-        BMCWEB_LOG_DEBUG << "doPatch...";
+        BMCWEB_LOG_DEBUG("doPatch...");
 
         std::optional<nlohmann::json> pushUriOptions;
         if (!json_util::readJsonPatch(req, asyncResp->res, "HttpPushUriOptions",
@@ -890,7 +886,7 @@
     }
     else
     {
-        BMCWEB_LOG_ERROR << "Unknown software purpose " << purpose;
+        BMCWEB_LOG_ERROR("Unknown software purpose {}", purpose);
     }
 }
 
@@ -926,16 +922,16 @@
 
         if (swInvPurpose == nullptr)
         {
-            BMCWEB_LOG_DEBUG << "Can't find property \"Purpose\"!";
+            BMCWEB_LOG_DEBUG("Can't find property \"Purpose\"!");
             messages::internalError(asyncResp->res);
             return;
         }
 
-        BMCWEB_LOG_DEBUG << "swInvPurpose = " << *swInvPurpose;
+        BMCWEB_LOG_DEBUG("swInvPurpose = {}", *swInvPurpose);
 
         if (version == nullptr)
         {
-            BMCWEB_LOG_DEBUG << "Can't find property \"Version\"!";
+            BMCWEB_LOG_DEBUG("Can't find property \"Version\"!");
 
             messages::internalError(asyncResp->res);
 
@@ -991,7 +987,7 @@
             [asyncResp,
              swId](const boost::system::error_code& ec,
                    const dbus::utility::MapperGetSubTreeResponse& subtree) {
-            BMCWEB_LOG_DEBUG << "doGet callback...";
+            BMCWEB_LOG_DEBUG("doGet callback...");
             if (ec)
             {
                 messages::internalError(asyncResp->res);
@@ -1022,7 +1018,7 @@
             }
             if (!found)
             {
-                BMCWEB_LOG_WARNING << "Input swID " << *swId << " not found!";
+                BMCWEB_LOG_WARNING("Input swID {} not found!", *swId);
                 messages::resourceMissingAtURI(
                     asyncResp->res,
                     boost::urls::format(