use std::format instead of fmt::format
The std::format is sufficient for the uses in this repository except
for in one file (override_fan_target.cpp, since P2286 isn't supported
by GCC yet). Switch to std::format whenever possible.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ib2576fb530a4d7ce238e1b0bd95b40b476ec2107
diff --git a/monitor/system.cpp b/monitor/system.cpp
index 4a33bb5..bb2e95e 100644
--- a/monitor/system.cpp
+++ b/monitor/system.cpp
@@ -167,7 +167,7 @@
if (serviceObjects.end() == itServ || itServ->second.empty())
{
getLogger().log(
- fmt::format("Fan sensor entry {} not found in D-Bus",
+ std::format("Fan sensor entry {} not found in D-Bus",
sensor->name()),
Logger::error);
continue;
@@ -304,7 +304,7 @@
bool hasOwner = !newOwner.empty() && oldOwner.empty();
std::string stateStr(hasOwner ? "online" : "offline");
- getLogger().log(fmt::format("Changing sensors for service {} to {}",
+ getLogger().log(std::format("Changing sensors for service {} to {}",
serviceName, stateStr),
Logger::info);
@@ -429,7 +429,7 @@
std::string fanPath{util::INVENTORY_PATH + fan.getName()};
getLogger().log(
- fmt::format("Creating event log for faulted fan {} sensor {}", fanPath,
+ std::format("Creating event log for faulted fan {} sensor {}", fanPath,
sensor.name()),
Logger::error);
@@ -473,7 +473,7 @@
std::string fanPath{util::INVENTORY_PATH + fan.getName()};
getLogger().log(
- fmt::format("Creating event log for missing fan {}", fanPath),
+ std::format("Creating event log for missing fan {}", fanPath),
Logger::error);
auto error = std::make_unique<FanError>(
@@ -568,7 +568,7 @@
catch (const std::exception& e)
{
getLogger().log(
- fmt::format("Caught exception while creating BMC dump: {}",
+ std::format("Caught exception while creating BMC dump: {}",
e.what()),
Logger::error);
}