From fbdc490808901519b41f2893879afea68995665f Mon Sep 17 00:00:00 2001 From: Drath Date: Sun, 2 Nov 2025 15:16:39 +0100 Subject: [PATCH] logging changes --- main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 61a819d..11c5ed4 100644 --- a/main.cpp +++ b/main.cpp @@ -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 funcs[] = {displayThread, hassThread, sensorsThread}; // array of functions