logging lib

This commit is contained in:
Drath
2025-10-03 16:57:38 +02:00
parent 31f2c8bf7c
commit 7e7d8d2aa1
12 changed files with 80 additions and 48 deletions

View File

@@ -9,11 +9,11 @@ void detectHwmon(cpuSensors* target, std::string pci) {
for (const auto& entry : std::filesystem::directory_iterator(path))
target->hwmon = getFirstDir(path);
} catch (...) {
std::println("[cpu::detectHwmon] NO CPU HWMON KERNEL MODULE DETECTED");
log(LOG::ERR, "cpu::detectHwmon", "NO CPU HWMON KERNEL MODULE DETECTED");
return;
}
target->zenpower = readFile((target->hwmon + "/name"), 128) == "zenpower";
std::println("[cpu::detectHwmon] Detected module \"{}\" in path \"{}\"", target->zenpower ? "zenpower" : "k10temp", target->hwmon);
log(LOG::INF, "cpu::detectHwmon", "Detected module \"{}\" in path \"{}\"", target->zenpower ? "zenpower" : "k10temp", target->hwmon);
}
void update(cpuSensors* c) {
@@ -29,7 +29,7 @@ void update(cpuSensors* c) {
c->vcore = (double)(std::stoul(readFile(c->hwmon + "/in1_input", 4)) / 1000.0);
// cpu.vsoc = (double)(std::stoul(readFile(hw.path + "/in2_input")) / 1000.0);
} else {
c->tctl = std::stoi(readFile(c->hwmon+ "/temp1_input", 2));
c->tctl = std::stoi(readFile(c->hwmon + "/temp1_input", 2));
c->tccd1 = std::stoi(readFile(c->hwmon + "/temp3_input", 2));
}