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/log_services.hpp b/redfish-core/lib/log_services.hpp
index 72930cc..9cb1fe0 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -159,8 +159,7 @@
     ret = sd_journal_get_realtime_usec(journal, &timestamp);
     if (ret < 0)
     {
-        BMCWEB_LOG_ERROR << "Failed to read entry timestamp: "
-                         << strerror(-ret);
+        BMCWEB_LOG_ERROR("Failed to read entry timestamp: {}", strerror(-ret));
         return false;
     }
     entryTimestamp = redfish::time_utils::getDateTimeUintUs(timestamp);
@@ -183,8 +182,7 @@
     ret = sd_journal_get_realtime_usec(journal, &curTs);
     if (ret < 0)
     {
-        BMCWEB_LOG_ERROR << "Failed to read entry timestamp: "
-                         << strerror(-ret);
+        BMCWEB_LOG_ERROR("Failed to read entry timestamp: {}", strerror(-ret));
         return false;
     }
     // If the timestamp isn't unique, increment the index
@@ -448,8 +446,8 @@
     }
     else
     {
-        BMCWEB_LOG_ERROR << "getDumpEntriesPath() invalid dump type: "
-                         << dumpType;
+        BMCWEB_LOG_ERROR("getDumpEntriesPath() invalid dump type: {}",
+                         dumpType);
     }
 
     // Returns empty string on error
@@ -475,7 +473,7 @@
                    const dbus::utility::ManagedObjectType& objects) {
         if (ec)
         {
-            BMCWEB_LOG_ERROR << "DumpEntry resp_handler got error " << ec;
+            BMCWEB_LOG_ERROR("DumpEntry resp_handler got error {}", ec);
             messages::internalError(asyncResp->res);
             return;
         }
@@ -592,7 +590,7 @@
                       const dbus::utility::ManagedObjectType& resp) {
         if (ec)
         {
-            BMCWEB_LOG_ERROR << "DumpEntry resp_handler got error " << ec;
+            BMCWEB_LOG_ERROR("DumpEntry resp_handler got error {}", ec);
             messages::internalError(asyncResp->res);
             return;
         }
@@ -665,7 +663,7 @@
         }
         if (!foundDumpEntry)
         {
-            BMCWEB_LOG_WARNING << "Can't find Dump Entry " << entryID;
+            BMCWEB_LOG_WARNING("Can't find Dump Entry {}", entryID);
             messages::resourceNotFound(asyncResp->res, dumpType + " dump",
                                        entryID);
             return;
@@ -679,7 +677,7 @@
 {
     auto respHandler =
         [asyncResp, entryID](const boost::system::error_code& ec) {
-        BMCWEB_LOG_DEBUG << "Dump Entry doDelete callback: Done";
+        BMCWEB_LOG_DEBUG("Dump Entry doDelete callback: Done");
         if (ec)
         {
             if (ec.value() == EBADR)
@@ -687,8 +685,9 @@
                 messages::resourceNotFound(asyncResp->res, "LogEntry", entryID);
                 return;
             }
-            BMCWEB_LOG_ERROR << "Dump (DBus) doDelete respHandler got error "
-                             << ec << " entryID=" << entryID;
+            BMCWEB_LOG_ERROR(
+                "Dump (DBus) doDelete respHandler got error {} entryID={}", ec,
+                entryID);
             messages::internalError(asyncResp->res);
             return;
         }
@@ -728,7 +727,7 @@
             const std::string* value = std::get_if<std::string>(&val);
             if (value == nullptr)
             {
-                BMCWEB_LOG_ERROR << "Status property value is null";
+                BMCWEB_LOG_ERROR("Status property value is null");
                 return DumpCreationProgress::DUMP_CREATE_FAILED;
             }
             return mapDbusStatusToDumpProgress(*value);
@@ -762,7 +761,7 @@
 
     if (dumpEntryPath.empty())
     {
-        BMCWEB_LOG_ERROR << "Invalid dump type received";
+        BMCWEB_LOG_ERROR("Invalid dump type received");
         messages::internalError(asyncResp->res);
         return;
     }
@@ -774,8 +773,8 @@
                  const std::string& introspectXml) {
         if (ec)
         {
-            BMCWEB_LOG_ERROR << "Introspect call failed with error: "
-                             << ec.message();
+            BMCWEB_LOG_ERROR("Introspect call failed with error: {}",
+                             ec.message());
             messages::internalError(asyncResp->res);
             return;
         }
@@ -790,7 +789,7 @@
         tinyxml2::XMLNode* pRoot = doc.FirstChildElement("node");
         if (pRoot == nullptr)
         {
-            BMCWEB_LOG_ERROR << "XML document failed to parse";
+            BMCWEB_LOG_ERROR("XML document failed to parse");
             messages::internalError(asyncResp->res);
             return;
         }
@@ -822,8 +821,8 @@
                 const std::shared_ptr<task::TaskData>& taskData) {
             if (ec2)
             {
-                BMCWEB_LOG_ERROR << createdObjPath.str
-                                 << ": Error in creating dump";
+                BMCWEB_LOG_ERROR("{}: Error in creating dump",
+                                 createdObjPath.str);
                 taskData->messages.emplace_back(messages::internalError());
                 taskData->state = "Cancelled";
                 return task::completed;
@@ -839,16 +838,16 @@
                     getDumpCompletionStatus(values);
                 if (dumpStatus == DumpCreationProgress::DUMP_CREATE_FAILED)
                 {
-                    BMCWEB_LOG_ERROR << createdObjPath.str
-                                     << ": Error in creating dump";
+                    BMCWEB_LOG_ERROR("{}: Error in creating dump",
+                                     createdObjPath.str);
                     taskData->state = "Cancelled";
                     return task::completed;
                 }
 
                 if (dumpStatus == DumpCreationProgress::DUMP_CREATE_INPROGRESS)
                 {
-                    BMCWEB_LOG_DEBUG << createdObjPath.str
-                                     << ": Dump creation task is in progress";
+                    BMCWEB_LOG_DEBUG("{}: Dump creation task is in progress",
+                                     createdObjPath.str);
                     return !task::completed;
                 }
             }
@@ -864,8 +863,8 @@
 
             taskData->payload->httpHeaders.emplace_back(std::move(headerLoc));
 
-            BMCWEB_LOG_DEBUG << createdObjPath.str
-                             << ": Dump creation task completed";
+            BMCWEB_LOG_DEBUG("{}: Dump creation task completed",
+                             createdObjPath.str);
             taskData->state = "Completed";
             return task::completed;
             },
@@ -907,8 +906,8 @@
     {
         if (!oemDiagnosticDataType || !diagnosticDataType)
         {
-            BMCWEB_LOG_ERROR
-                << "CreateDump action parameter 'DiagnosticDataType'/'OEMDiagnosticDataType' value not found!";
+            BMCWEB_LOG_ERROR(
+                "CreateDump action parameter 'DiagnosticDataType'/'OEMDiagnosticDataType' value not found!");
             messages::actionParameterMissing(
                 asyncResp->res, "CollectDiagnosticData",
                 "DiagnosticDataType & OEMDiagnosticDataType");
@@ -917,7 +916,7 @@
         if ((*oemDiagnosticDataType != "System") ||
             (*diagnosticDataType != "OEM"))
         {
-            BMCWEB_LOG_ERROR << "Wrong parameter values passed";
+            BMCWEB_LOG_ERROR("Wrong parameter values passed");
             messages::internalError(asyncResp->res);
             return;
         }
@@ -927,16 +926,16 @@
     {
         if (!diagnosticDataType)
         {
-            BMCWEB_LOG_ERROR
-                << "CreateDump action parameter 'DiagnosticDataType' not found!";
+            BMCWEB_LOG_ERROR(
+                "CreateDump action parameter 'DiagnosticDataType' not found!");
             messages::actionParameterMissing(
                 asyncResp->res, "CollectDiagnosticData", "DiagnosticDataType");
             return;
         }
         if (*diagnosticDataType != "Manager")
         {
-            BMCWEB_LOG_ERROR
-                << "Wrong parameter value passed for 'DiagnosticDataType'";
+            BMCWEB_LOG_ERROR(
+                "Wrong parameter value passed for 'DiagnosticDataType'");
             messages::internalError(asyncResp->res);
             return;
         }
@@ -944,7 +943,7 @@
     }
     else
     {
-        BMCWEB_LOG_ERROR << "CreateDump failed. Unknown dump type";
+        BMCWEB_LOG_ERROR("CreateDump failed. Unknown dump type");
         messages::internalError(asyncResp->res);
         return;
     }
@@ -969,7 +968,7 @@
                    const sdbusplus::message::object_path& objPath) mutable {
         if (ec)
         {
-            BMCWEB_LOG_ERROR << "CreateDump resp_handler got error " << ec;
+            BMCWEB_LOG_ERROR("CreateDump resp_handler got error {}", ec);
             const sd_bus_error* dbusError = msg.get_error();
             if (dbusError == nullptr)
             {
@@ -977,8 +976,8 @@
                 return;
             }
 
-            BMCWEB_LOG_ERROR << "CreateDump DBus error: " << dbusError->name
-                             << " and error msg: " << dbusError->message;
+            BMCWEB_LOG_ERROR("CreateDump DBus error: {} and error msg: {}",
+                             dbusError->name, dbusError->message);
             if (std::string_view(
                     "xyz.openbmc_project.Common.Error.NotAllowed") ==
                 dbusError->name)
@@ -1010,7 +1009,7 @@
             messages::internalError(asyncResp->res);
             return;
         }
-        BMCWEB_LOG_DEBUG << "Dump Created. Path: " << objPath.str;
+        BMCWEB_LOG_DEBUG("Dump Created. Path: {}", objPath.str);
         createDumpTaskCallback(std::move(payload), asyncResp, objPath);
         },
         "xyz.openbmc_project.Dump.Manager",
@@ -1029,7 +1028,7 @@
         [asyncResp](const boost::system::error_code& ec) {
         if (ec)
         {
-            BMCWEB_LOG_ERROR << "clearDump resp_handler got error " << ec;
+            BMCWEB_LOG_ERROR("clearDump resp_handler got error {}", ec);
             messages::internalError(asyncResp->res);
             return;
         }
@@ -1148,7 +1147,7 @@
                             subtreePath) {
             if (ec)
             {
-                BMCWEB_LOG_ERROR << ec;
+                BMCWEB_LOG_ERROR("{}", ec);
                 return;
             }
 
@@ -1252,7 +1251,7 @@
             [asyncResp](const boost::system::error_code& ec) {
             if (ec)
             {
-                BMCWEB_LOG_ERROR << "Failed to reload rsyslog: " << ec;
+                BMCWEB_LOG_ERROR("Failed to reload rsyslog: {}", ec);
                 messages::internalError(asyncResp->res);
                 return;
             }
@@ -1309,7 +1308,7 @@
     logEntryIter++;
     if (message == nullptr)
     {
-        BMCWEB_LOG_WARNING << "Log entry not found in registry: " << logEntry;
+        BMCWEB_LOG_WARNING("Log entry not found in registry: {}", logEntry);
         return LogParseError::messageIdNotInRegistry;
     }
 
@@ -1584,8 +1583,8 @@
             if (ec)
             {
                 // TODO Handle for specific error code
-                BMCWEB_LOG_ERROR
-                    << "getLogEntriesIfaceData resp_handler got error " << ec;
+                BMCWEB_LOG_ERROR(
+                    "getLogEntriesIfaceData resp_handler got error {}", ec);
                 messages::internalError(asyncResp->res);
                 return;
             }
@@ -1781,8 +1780,8 @@
             }
             if (ec)
             {
-                BMCWEB_LOG_ERROR
-                    << "EventLogEntry (DBus) resp_handler got error " << ec;
+                BMCWEB_LOG_ERROR(
+                    "EventLogEntry (DBus) resp_handler got error {}", ec);
                 messages::internalError(asyncResp->res);
                 return;
             }
@@ -1883,7 +1882,7 @@
         {
             return;
         }
-        BMCWEB_LOG_DEBUG << "Set Resolved";
+        BMCWEB_LOG_DEBUG("Set Resolved");
 
         sdbusplus::asio::setProperty(
             *crow::connections::systemBus, "xyz.openbmc_project.Logging",
@@ -1892,7 +1891,7 @@
             [asyncResp, entryId](const boost::system::error_code& ec) {
             if (ec)
             {
-                BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+                BMCWEB_LOG_DEBUG("DBUS response error {}", ec);
                 messages::internalError(asyncResp->res);
                 return;
             }
@@ -1924,7 +1923,7 @@
                                        systemName);
             return;
         }
-        BMCWEB_LOG_DEBUG << "Do delete single event entries.";
+        BMCWEB_LOG_DEBUG("Do delete single event entries.");
 
         std::string entryID = param;
 
@@ -1933,7 +1932,7 @@
         // Process response from Logging service.
         auto respHandler =
             [asyncResp, entryID](const boost::system::error_code& ec) {
-            BMCWEB_LOG_DEBUG << "EventLogEntry (DBus) doDelete callback: Done";
+            BMCWEB_LOG_DEBUG("EventLogEntry (DBus) doDelete callback: Done");
             if (ec)
             {
                 if (ec.value() == EBADR)
@@ -1943,9 +1942,9 @@
                     return;
                 }
                 // TODO Handle for specific error code
-                BMCWEB_LOG_ERROR
-                    << "EventLogEntry (DBus) doDelete respHandler got error "
-                    << ec;
+                BMCWEB_LOG_ERROR(
+                    "EventLogEntry (DBus) doDelete respHandler got error {}",
+                    ec);
                 asyncResp->res.result(
                     boost::beast::http::status::internal_server_error);
                 return;
@@ -2011,7 +2010,7 @@
             }
             if (ec)
             {
-                BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+                BMCWEB_LOG_DEBUG("DBUS response error {}", ec);
                 messages::internalError(asyncResp->res);
                 return;
             }
@@ -2035,8 +2034,8 @@
             constexpr int maxFileSize = 65536;
             if (size > maxFileSize)
             {
-                BMCWEB_LOG_ERROR << "File size exceeds maximum allowed size of "
-                                 << maxFileSize;
+                BMCWEB_LOG_ERROR("File size exceeds maximum allowed size of {}",
+                                 maxFileSize);
                 messages::internalError(asyncResp->res);
                 return;
             }
@@ -2080,7 +2079,7 @@
     std::filesystem::directory_iterator logPath(hostLoggerFilePath, ec);
     if (ec)
     {
-        BMCWEB_LOG_ERROR << ec.message();
+        BMCWEB_LOG_ERROR("{}", ec.message());
         return false;
     }
     for (const std::filesystem::directory_entry& it : logPath)
@@ -2113,7 +2112,7 @@
     {
         if (!logFile.gzGetLines(it.string(), skip, top, logEntries, logCount))
         {
-            BMCWEB_LOG_ERROR << "fail to expose host logs";
+            BMCWEB_LOG_ERROR("fail to expose host logs");
             return false;
         }
     }
@@ -2230,7 +2229,7 @@
         std::vector<std::filesystem::path> hostLoggerFiles;
         if (!getHostLoggerFiles(hostLoggerFolderPath, hostLoggerFiles))
         {
-            BMCWEB_LOG_ERROR << "fail to get host log file path";
+            BMCWEB_LOG_ERROR("fail to get host log file path");
             return;
         }
         // If we weren't provided top and skip limits, use the defaults.
@@ -2316,7 +2315,7 @@
         std::vector<std::filesystem::path> hostLoggerFiles;
         if (!getHostLoggerFiles(hostLoggerFolderPath, hostLoggerFiles))
         {
-            BMCWEB_LOG_ERROR << "fail to get host log file path";
+            BMCWEB_LOG_ERROR("fail to get host log file path");
             return;
         }
 
@@ -2384,9 +2383,9 @@
             const dbus::utility::MapperGetSubTreePathsResponse& subTreePaths) {
         if (ec)
         {
-            BMCWEB_LOG_ERROR
-                << "handleBMCLogServicesCollectionGet respHandler got error "
-                << ec;
+            BMCWEB_LOG_ERROR(
+                "handleBMCLogServicesCollectionGet respHandler got error {}",
+                ec);
             // Assume that getting an error simply means there are no dump
             // LogServices. Return without adding any error response.
             return;
@@ -2471,8 +2470,8 @@
     ret = getJournalMetadata(journal, "SYSLOG_IDENTIFIER", syslogID);
     if (ret < 0)
     {
-        BMCWEB_LOG_ERROR << "Failed to read SYSLOG_IDENTIFIER field: "
-                         << strerror(-ret);
+        BMCWEB_LOG_ERROR("Failed to read SYSLOG_IDENTIFIER field: {}",
+                         strerror(-ret));
     }
     if (!syslogID.empty())
     {
@@ -2483,7 +2482,7 @@
     ret = getJournalMetadata(journal, "MESSAGE", msg);
     if (ret < 0)
     {
-        BMCWEB_LOG_ERROR << "Failed to read MESSAGE field: " << strerror(-ret);
+        BMCWEB_LOG_ERROR("Failed to read MESSAGE field: {}", strerror(-ret));
         return 1;
     }
     message += std::string(msg);
@@ -2493,7 +2492,7 @@
     ret = getJournalMetadata(journal, "PRIORITY", 10, severity);
     if (ret < 0)
     {
-        BMCWEB_LOG_ERROR << "Failed to read PRIORITY field: " << strerror(-ret);
+        BMCWEB_LOG_ERROR("Failed to read PRIORITY field: {}", strerror(-ret));
     }
 
     // Get the Created time from the timestamp
@@ -2559,7 +2558,7 @@
         int ret = sd_journal_open(&journalTmp, SD_JOURNAL_LOCAL_ONLY);
         if (ret < 0)
         {
-            BMCWEB_LOG_ERROR << "failed to open journal: " << strerror(-ret);
+            BMCWEB_LOG_ERROR("failed to open journal: {}", strerror(-ret));
             messages::internalError(asyncResp->res);
             return;
         }
@@ -2630,7 +2629,7 @@
         int ret = sd_journal_open(&journalTmp, SD_JOURNAL_LOCAL_ONLY);
         if (ret < 0)
         {
-            BMCWEB_LOG_ERROR << "failed to open journal: " << strerror(-ret);
+            BMCWEB_LOG_ERROR("failed to open journal: {}", strerror(-ret));
             messages::internalError(asyncResp->res);
             return;
         }
@@ -2644,8 +2643,8 @@
         ret = sd_journal_seek_realtime_usec(journal.get(), ts);
         if (ret < 0)
         {
-            BMCWEB_LOG_ERROR << "failed to seek to an entry in journal"
-                             << strerror(-ret);
+            BMCWEB_LOG_ERROR("failed to seek to an entry in journal{}",
+                             strerror(-ret));
             messages::internalError(asyncResp->res);
             return;
         }
@@ -2705,8 +2704,8 @@
     }
     else
     {
-        BMCWEB_LOG_ERROR << "getDumpServiceInfo() invalid dump type: "
-                         << dumpType;
+        BMCWEB_LOG_ERROR("getDumpServiceInfo() invalid dump type: {}",
+                         dumpType);
         messages::internalError(asyncResp->res);
         return;
     }
@@ -2741,8 +2740,7 @@
             const dbus::utility::MapperGetSubTreePathsResponse& subTreePaths) {
         if (ec)
         {
-            BMCWEB_LOG_ERROR << "getDumpServiceInfo respHandler got error "
-                             << ec;
+            BMCWEB_LOG_ERROR("getDumpServiceInfo respHandler got error {}", ec);
             // Assume that getting an error simply means there are no dump
             // LogServices. Return without adding any error response.
             return;
@@ -3212,7 +3210,7 @@
                         const dbus::utility::DBusPropertiesMap& params) {
         if (ec)
         {
-            BMCWEB_LOG_DEBUG << "failed to get log ec: " << ec.message();
+            BMCWEB_LOG_DEBUG("failed to get log ec: {}", ec.message());
             if (ec.value() ==
                 boost::system::linux_error::bad_request_descriptor)
             {
@@ -3317,8 +3315,8 @@
                 if (ec.value() !=
                     boost::system::errc::no_such_file_or_directory)
                 {
-                    BMCWEB_LOG_DEBUG << "failed to get entries ec: "
-                                     << ec.message();
+                    BMCWEB_LOG_DEBUG("failed to get entries ec: {}",
+                                     ec.message());
                     messages::internalError(asyncResp->res);
                     return;
                 }
@@ -3424,7 +3422,7 @@
                     resp) {
             if (ec)
             {
-                BMCWEB_LOG_DEBUG << "failed to get log ec: " << ec.message();
+                BMCWEB_LOG_DEBUG("failed to get log ec: {}", ec.message());
                 messages::internalError(asyncResp->res);
                 return;
             }
@@ -3536,8 +3534,8 @@
 
         if (diagnosticDataType != "OEM")
         {
-            BMCWEB_LOG_ERROR
-                << "Only OEM DiagnosticDataType supported for Crashdump";
+            BMCWEB_LOG_ERROR(
+                "Only OEM DiagnosticDataType supported for Crashdump");
             messages::actionParameterValueFormatError(
                 asyncResp->res, diagnosticDataType, "DiagnosticDataType",
                 "CollectDiagnosticData");
@@ -3570,8 +3568,8 @@
         }
         else
         {
-            BMCWEB_LOG_ERROR << "Unsupported OEMDiagnosticDataType: "
-                             << oemDiagnosticDataType;
+            BMCWEB_LOG_ERROR("Unsupported OEMDiagnosticDataType: {}",
+                             oemDiagnosticDataType);
             messages::actionParameterValueFormatError(
                 asyncResp->res, oemDiagnosticDataType, "OEMDiagnosticDataType",
                 "CollectDiagnosticData");
@@ -3660,15 +3658,15 @@
                                        systemName);
             return;
         }
-        BMCWEB_LOG_DEBUG << "Do delete all entries.";
+        BMCWEB_LOG_DEBUG("Do delete all entries.");
 
         // Process response from Logging service.
         auto respHandler = [asyncResp](const boost::system::error_code& ec) {
-            BMCWEB_LOG_DEBUG << "doClearLog resp_handler callback: Done";
+            BMCWEB_LOG_DEBUG("doClearLog resp_handler callback: Done");
             if (ec)
             {
                 // TODO Handle for specific error code
-                BMCWEB_LOG_ERROR << "doClearLog resp_handler got error " << ec;
+                BMCWEB_LOG_ERROR("doClearLog resp_handler got error {}", ec);
                 asyncResp->res.result(
                     boost::beast::http::status::internal_server_error);
                 return;
@@ -3766,7 +3764,7 @@
                                        systemName);
             return;
         }
-        BMCWEB_LOG_DEBUG << "Do delete all postcodes entries.";
+        BMCWEB_LOG_DEBUG("Do delete all postcodes entries.");
 
         // Make call to post-code service to request clear all
         crow::connections::systemBus->async_method_call(
@@ -3774,8 +3772,8 @@
             if (ec)
             {
                 // TODO Handle for specific error code
-                BMCWEB_LOG_ERROR << "doClearPostCodes resp_handler got error "
-                                 << ec;
+                BMCWEB_LOG_ERROR("doClearPostCodes resp_handler got error {}",
+                                 ec);
                 asyncResp->res.result(
                     boost::beast::http::status::internal_server_error);
                 messages::internalError(asyncResp->res);
@@ -3982,7 +3980,7 @@
                         postcode) {
         if (ec)
         {
-            BMCWEB_LOG_DEBUG << "DBUS POST CODE PostCode response error";
+            BMCWEB_LOG_DEBUG("DBUS POST CODE PostCode response error");
             messages::internalError(asyncResp->res);
             return;
         }
@@ -4018,7 +4016,7 @@
                   postcode) {
         if (ec)
         {
-            BMCWEB_LOG_DEBUG << "DBUS POST CODE PostCode response error";
+            BMCWEB_LOG_DEBUG("DBUS POST CODE PostCode response error");
             messages::internalError(asyncResp->res);
             return;
         }
@@ -4075,7 +4073,7 @@
                                            const uint16_t bootCount) {
         if (ec)
         {
-            BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+            BMCWEB_LOG_DEBUG("DBUS response error {}", ec);
             messages::internalError(asyncResp->res);
             return;
         }
@@ -4188,7 +4186,7 @@
             }
             if (ec)
             {
-                BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+                BMCWEB_LOG_DEBUG("DBUS response error {}", ec);
                 messages::internalError(asyncResp->res);
                 return;
             }
@@ -4196,7 +4194,7 @@
             size_t value = static_cast<size_t>(currentValue) - 1;
             if (value == std::string::npos || postcodes.size() < currentValue)
             {
-                BMCWEB_LOG_WARNING << "Wrong currentValue value";
+                BMCWEB_LOG_WARNING("Wrong currentValue value");
                 messages::resourceNotFound(asyncResp->res, "LogEntry",
                                            postCodeID);
                 return;
@@ -4205,7 +4203,7 @@
             const auto& [tID, c] = postcodes[value];
             if (c.empty())
             {
-                BMCWEB_LOG_WARNING << "No found post code data";
+                BMCWEB_LOG_WARNING("No found post code data");
                 messages::resourceNotFound(asyncResp->res, "LogEntry",
                                            postCodeID);
                 return;