logging changes

This commit is contained in:
Drath
2025-11-02 15:16:39 +01:00
parent 19a801459c
commit fbdc490808

View File

@@ -48,6 +48,7 @@ void sighandler(int) {
}
void hassThread(std::stop_token st, Sensors* s) {
log(LOG::INF, "Thread", "Starting hass_thread");
HomeAssistant pc_power("home.drath.win", "sensor.gniazdko_komputer_moc");
pc_power.connect();
@@ -64,7 +65,7 @@ void hassThread(std::stop_token st, Sensors* s) {
}
void sensorsThread(std::stop_token st, Sensors* s) {
log(LOG::INF, "Thread", "Starting sensors_thread, pid {}, poll interval {} ms", gettid(), LCD_INTERVAL_MS);
log(LOG::INF, "Thread", "Starting sensors_thread, poll interval {} ms", LCD_INTERVAL_MS);
cpu::detectHwmon(&s->cpu, "0000:00:18.3");
gpu::detectHwmon(&s->gpu, "0000:0b:00.0");
sys::detectHwmon(&s->sys, "nct6775.656");
@@ -92,7 +93,7 @@ void sensorsThread(std::stop_token st, Sensors* s) {
}
void displayThread(std::stop_token st, Sensors* s) {
log(LOG::INF, "Thread", "Starting display_thread, pid {}", gettid());
log(LOG::INF, "Thread", "Starting display_thread");
// init internal variables of LCDDisplay class
LCDDisplay lcd(LCD_PORT);
@@ -164,7 +165,7 @@ int main() {
std::signal(SIGTERM, sighandler);
Sensors* pSensors = new Sensors;
log(LOG::DBG, "main", "size of sensor struct is {} bytes", sizeof(Sensors));
log(LOG::DBG, "main", "main thread pid is {}, size of sensor struct is {} bytes", gettid(),sizeof(Sensors));
std::function<void(std::stop_token st, Sensors * s)> funcs[] = {displayThread, hassThread, sensorsThread}; // array of functions