From 7970192c1af6b5d798e3b5741f02d04db05918c7 Mon Sep 17 00:00:00 2001 From: Torrie Fischer Date: Mon, 11 Dec 2023 07:49:23 +0100 Subject: [PATCH] figments: mainloop: print warning if task couldnt be found --- lib/Figments/MainLoop.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Figments/MainLoop.cpp b/lib/Figments/MainLoop.cpp index c8202c8..bfc5778 100644 --- a/lib/Figments/MainLoop.cpp +++ b/lib/Figments/MainLoop.cpp @@ -24,17 +24,23 @@ MainLoop::dispatchSync(const InputEvent& evt) { if (evt.intent == InputEvent::StartThing || evt.intent == InputEvent::StopThing) { const bool jobState = (evt.intent == InputEvent::StartThing); + bool wasFound = false; for(auto figmentJob: scheduler.tasks) { if (!strcmp(figmentJob->name, evt.asString())) { if (jobState) { Log.trace("** Starting %s", figmentJob->name); figmentJob->start(); + wasFound = true; } else { Log.trace("** Stopping %s", figmentJob->name); figmentJob->stop(); + wasFound = true; } } } + if (!wasFound) { + Log.warning("** Unable to find task %s", evt.asString()); + } } for(Task* task : scheduler) {