it was colliding with math log, renamed to applog
This commit is contained in:
10
main.cpp
10
main.cpp
@@ -43,13 +43,13 @@ struct Sensors {
|
||||
};
|
||||
|
||||
void signalHandler(int) {
|
||||
log(LOG::WRN, "got SIGINT/SIGTERM, exiting...");
|
||||
applog(LOG::WRN, "got SIGINT/SIGTERM, exiting...");
|
||||
sem::main.release();
|
||||
sem::display.release();
|
||||
}
|
||||
|
||||
void hassThread(std::stop_token st, Sensors* s) {
|
||||
log(LOG::INF, "Thread started");
|
||||
applog(LOG::INF, "Thread started");
|
||||
HomeAssistant pc_power("home.drath.win", "sensor.gniazdko_komputer_moc");
|
||||
|
||||
pc_power.connect();
|
||||
@@ -66,7 +66,7 @@ void hassThread(std::stop_token st, Sensors* s) {
|
||||
}
|
||||
|
||||
void sensorsThread(std::stop_token st, Sensors* s) {
|
||||
log(LOG::INF, "Thread started, poll interval {} ms", LCD_INTERVAL_MS);
|
||||
applog(LOG::INF, "Thread started, 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");
|
||||
@@ -94,7 +94,7 @@ void sensorsThread(std::stop_token st, Sensors* s) {
|
||||
}
|
||||
|
||||
void displayThread(std::stop_token st, Sensors* s) {
|
||||
log(LOG::INF, "Thread started");
|
||||
applog(LOG::INF, "Thread started");
|
||||
// init internal variables of LCDDisplay class
|
||||
LCDDisplay lcd(LCD_PORT);
|
||||
|
||||
@@ -165,7 +165,7 @@ void displayThread(std::stop_token st, Sensors* s) {
|
||||
}
|
||||
|
||||
int main() {
|
||||
log(LOG::START, "============================= PROGRAM START ============================="); // to make logs clearer
|
||||
applog(LOG::START, "============================= PROGRAM START ============================="); // to make logs clearer
|
||||
std::signal(SIGINT, signalHandler);
|
||||
std::signal(SIGTERM, signalHandler);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user