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/presence/error_reporter.cpp b/presence/error_reporter.cpp
index 1b46bdf..790a260 100644
--- a/presence/error_reporter.cpp
+++ b/presence/error_reporter.cpp
@@ -20,13 +20,14 @@
#include "psensor.hpp"
#include "utility.hpp"
-#include <fmt/format.h>
#include <unistd.h>
#include <phosphor-logging/log.hpp>
#include <xyz/openbmc_project/Logging/Create/server.hpp>
#include <xyz/openbmc_project/Logging/Entry/server.hpp>
+#include <format>
+
namespace phosphor::fan::presence
{
@@ -108,7 +109,7 @@
present = std::get<bool>(presentProp->second);
if (_fanStates[fanPath] != present)
{
- getLogger().log(fmt::format("Fan {} presence state change to {}",
+ getLogger().log(std::format("Fan {} presence state change to {}",
fanPath, present));
_fanStates[fanPath] = present;
@@ -147,7 +148,7 @@
void ErrorReporter::fanMissingTimerExpired(const std::string& fanPath)
{
getLogger().log(
- fmt::format("Creating event log for missing fan {}", fanPath),
+ std::format("Creating event log for missing fan {}", fanPath),
Logger::error);
std::map<std::string, std::string> additionalData;
@@ -184,7 +185,7 @@
catch (const util::DBusError& e)
{
getLogger().log(
- fmt::format(
+ std::format(
"Call to create an error log for missing fan {} failed: {}",
fanPath, e.what()),
Logger::error);
@@ -208,7 +209,7 @@
if (missing)
{
getLogger().log(
- fmt::format("At power on, there are {} missing fans", missing));
+ std::format("At power on, there are {} missing fans", missing));
}
}