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/hwmon_ffdc.cpp b/hwmon_ffdc.cpp
index d8069e4..cd8417a 100644
--- a/hwmon_ffdc.cpp
+++ b/hwmon_ffdc.cpp
@@ -2,10 +2,9 @@
#include "logging.hpp"
-#include <fmt/format.h>
-
#include <array>
#include <filesystem>
+#include <format>
#include <fstream>
#include <string>
#include <vector>
@@ -28,7 +27,7 @@
if (!pipe)
{
getLogger().log(
- fmt::format("popen() failed when running command: {}", command));
+ std::format("popen() failed when running command: {}", command));
return output;
}
while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr)
@@ -46,7 +45,7 @@
if (!fs::exists(hwmonBaseDir))
{
- getLogger().log(fmt::format("Hwmon base directory {} doesn't exist",
+ getLogger().log(std::format("Hwmon base directory {} doesn't exist",
hwmonBaseDir.native()));
return hwmonNames;
}
@@ -76,7 +75,7 @@
catch (const std::exception& e)
{
getLogger().log(
- fmt::format("Error traversing hwmon directories: {}", e.what()));
+ std::format("Error traversing hwmon directories: {}", e.what()));
}
return hwmonNames;