summaryrefslogtreecommitdiff
path: root/redfish-core/lib/log_services.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'redfish-core/lib/log_services.hpp')
-rw-r--r--redfish-core/lib/log_services.hpp186
1 files changed, 92 insertions, 94 deletions
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 72930cc79f..9cb1fe0580 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -159,8 +159,7 @@ inline static bool getEntryTimestamp(sd_journal* journal,
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 @@ inline static bool getUniqueEntryID(sd_journal* journal, std::string& entryID,
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 @@ static std::string getDumpEntriesPath(const std::string& dumpType)
}
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 @@ inline void
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 @@ inline void
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 @@ inline void
}
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 @@ inline void deleteDumpEntry(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
{
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 @@ inline void deleteDumpEntry(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
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 @@ inline DumpCreationProgress
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 @@ inline void createDumpTaskCallback(
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 @@ inline void createDumpTaskCallback(
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 @@ inline void createDumpTaskCallback(
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 @@ inline void createDumpTaskCallback(
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 @@ inline void createDumpTaskCallback(
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 @@ inline void createDumpTaskCallback(
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 @@ inline void createDump(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
{
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 @@ inline void createDump(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
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 @@ inline void createDump(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
{
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 @@ inline void createDump(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
}
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 @@ inline void createDump(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
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 @@ inline void createDump(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
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 @@ inline void createDump(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
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 @@ inline void clearDump(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
[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 @@ inline void requestRoutesSystemLogServiceCollection(App& app)
subtreePath) {
if (ec)
{
- BMCWEB_LOG_ERROR << ec;
+ BMCWEB_LOG_ERROR("{}", ec);
return;
}
@@ -1252,7 +1251,7 @@ inline void requestRoutesJournalEventLogClear(App& app)
[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 @@ static LogParseError
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 @@ inline void requestRoutesDBusEventLogEntryCollection(App& app)
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 @@ inline void requestRoutesDBusEventLogEntry(App& app)
}
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 @@ inline void requestRoutesDBusEventLogEntry(App& app)
{
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 @@ inline void requestRoutesDBusEventLogEntry(App& app)
[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 @@ inline void requestRoutesDBusEventLogEntry(App& app)
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 @@ inline void requestRoutesDBusEventLogEntry(App& app)
// 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 @@ inline void requestRoutesDBusEventLogEntry(App& app)
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 @@ inline void requestRoutesDBusEventLogEntryDownload(App& app)
}
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 @@ inline void requestRoutesDBusEventLogEntryDownload(App& app)
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 @@ inline bool
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 @@ inline bool getHostLoggerEntries(
{
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 @@ inline void requestRoutesSystemHostLoggerCollection(App& app)
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 @@ inline void requestRoutesSystemHostLoggerLogEntry(App& app)
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 @@ inline void handleBMCLogServicesCollectionGet(
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 @@ static int
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 @@ static int
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 @@ static int
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 @@ inline void requestRoutesBMCJournalLogEntryCollection(App& app)
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 @@ inline void requestRoutesBMCJournalLogEntry(App& app)
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 @@ inline void requestRoutesBMCJournalLogEntry(App& app)
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 @@ inline void
}
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 @@ inline void
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 @@ static void
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 @@ inline void requestRoutesCrashdumpEntryCollection(App& app)
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 @@ inline void requestRoutesCrashdumpFile(App& app)
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 @@ inline void requestRoutesCrashdumpCollect(App& app)
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 @@ inline void requestRoutesCrashdumpCollect(App& app)
}
else
{
- BMCWEB_LOG_ERROR << "Unsupported OEMDiagnosticDataType: "
- << oemDiagnosticDataType;
+ BMCWEB_LOG_ERROR("Unsupported OEMDiagnosticDataType: {}",
+ oemDiagnosticDataType);
messages::actionParameterValueFormatError(
asyncResp->res, oemDiagnosticDataType, "OEMDiagnosticDataType",
"CollectDiagnosticData");
@@ -3660,15 +3658,15 @@ inline void requestRoutesDBusLogServiceActionsClear(App& app)
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 @@ inline void requestRoutesPostCodesClear(App& app)
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 @@ inline void requestRoutesPostCodesClear(App& app)
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 @@ static void
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 @@ static void
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 @@ static void
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 @@ inline void requestRoutesPostCodesEntryAdditionalData(App& app)
}
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 @@ inline void requestRoutesPostCodesEntryAdditionalData(App& app)
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 @@ inline void requestRoutesPostCodesEntryAdditionalData(App& app)
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;