figments: mainloop: better startup logs

This commit is contained in:
Torrie Fischer 2023-02-18 16:22:37 +01:00
parent b244a28c6e
commit 242182d460

View File

@ -24,10 +24,10 @@ MainLoop::loop()
for(auto figmentJob: scheduler.tasks) { for(auto figmentJob: scheduler.tasks) {
if (!strcmp(figmentJob->name, evt.asString())) { if (!strcmp(figmentJob->name, evt.asString())) {
if (jobState) { if (jobState) {
Log.trace("Starting task %s", figmentJob->name); Log.trace("** Starting %s", figmentJob->name);
figmentJob->start(); figmentJob->start();
} else { } else {
Log.trace("Stopping task %s", figmentJob->name); Log.trace("** Stopping %s", figmentJob->name);
figmentJob->stop(); figmentJob->stop();
} }
} }
@ -35,9 +35,7 @@ MainLoop::loop()
} }
for(Task* task : scheduler) { for(Task* task : scheduler) {
if (evt.intent == InputEvent::SetPower) { Log.verbose("** Eventing %s", task->name);
Log.notice("Event %s", task->name);
}
task->handleEvent(evt); task->handleEvent(evt);
} }
} }
@ -78,6 +76,7 @@ void
MainLoop::start() MainLoop::start()
{ {
s_instance = this; s_instance = this;
Log.notice("Welcome to 🌕 Figment 0.3.0");
Log.notice("*** Starting %d tasks...", scheduler.tasks.size()); Log.notice("*** Starting %d tasks...", scheduler.tasks.size());
Serial.flush(); Serial.flush();
for(auto task: scheduler) { for(auto task: scheduler) {