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/control/json/actions/action.hpp b/control/json/actions/action.hpp
index dcba6ea..0377a8a 100644
--- a/control/json/actions/action.hpp
+++ b/control/json/actions/action.hpp
@@ -20,12 +20,11 @@
#include "config_base.hpp"
#include "group.hpp"
-#include <fmt/format.h>
-
#include <nlohmann/json.hpp>
#include <phosphor-logging/log.hpp>
#include <algorithm>
+#include <format>
#include <functional>
#include <iterator>
#include <map>
@@ -67,7 +66,7 @@
*/
ActionParseError(const std::string& name, const std::string& details) :
std::runtime_error(
- fmt::format("Failed to parse action {} [{}]", name, details)
+ std::format("Failed to parse action {} [{}]", name, details)
.c_str())
{}
};
@@ -299,7 +298,7 @@
else
{
log<level::ERR>(
- fmt::format("Action '{}' is already registered", name).c_str());
+ std::format("Action '{}' is already registered", name).c_str());
throw std::runtime_error("Actions with the same name found");
}
@@ -338,7 +337,7 @@
return std::move(list) + ", " + act.first;
});
log<level::ERR>(
- fmt::format("Action '{}' is not registered", name).c_str(),
+ std::format("Action '{}' is not registered", name).c_str(),
entry("AVAILABLE_ACTIONS=%s", acts.c_str()));
throw std::runtime_error("Unsupported action name given");
}