move from iostream to print

This commit is contained in:
Drath
2025-07-27 01:16:23 +02:00
parent ada9d22713
commit 3008ab4d06
3 changed files with 16 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
#include <cstdint>
#include <fstream>
#include <iostream>
#include <print>
#include <sstream>
#include <string>
#include <utils.hpp>
@@ -11,7 +11,7 @@ std::string readFile(std::string path, uint8_t trim) {
std::stringstream ss;
std::ifstream fs(path);
if (!fs.good()) {
std::cerr << "[readFile] Error reading " << path << std::endl;
std::println("[readFile] Error reading {}", path);
return "";
}
ss << fs.rdbuf();
@@ -38,7 +38,7 @@ std::string findHwmonPath(std::string module) {
auto f = readFile("/sys/class/hwmon/hwmon" + std::to_string(id) + "/name");
if (f.size() == 0) break;
if (f == module) {
std::cout << ("[Hwmon] Detected " + module + " path is " + "/sys/class/hwmon/hwmon" + std::to_string(id)) << std::endl;
std::println("[Hwmon] Detected {} path is /sys/class/hwmon/hwmon{}", module, id);
return "/sys/class/hwmon/hwmon" + std::to_string(id);
}
}