threads: add logging
This commit is contained in:
@@ -5,16 +5,19 @@
|
||||
*/
|
||||
|
||||
#include "UserInterface.h"
|
||||
#include "Log.h"
|
||||
#include <cstring>
|
||||
|
||||
UserInterface::UserInterface(ThreadCommon::QueueManager* qm) :
|
||||
_qm(qm), lcd1(nullptr)
|
||||
{
|
||||
LOG_DEBUG("Creating UserInterface");
|
||||
this->initLCD1();
|
||||
}
|
||||
|
||||
UserInterface::~UserInterface()
|
||||
{
|
||||
LOG_ERROR("Deleting UserInterface");
|
||||
delete this->lcd1;
|
||||
delete this->lcd1_rs;
|
||||
delete this->lcd1_en;
|
||||
@@ -45,7 +48,7 @@ void UserInterface::handleEvent(InterfaceWithData* ui_data)
|
||||
break;
|
||||
default:
|
||||
//Should never happen.
|
||||
printf("WARNING: [UserInterface::handleEvent] executed default case.\n");
|
||||
LOG_ERROR("[UserInterface::handleEvent] executed default case");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -59,11 +62,13 @@ void UserInterface::handleLCD(LiquidCrystal *lcd, const char *str)
|
||||
//Interpret empty string as clear.
|
||||
if(!strlen(str))
|
||||
lcd->clear();
|
||||
LOG_INFO("Clear up LCD");
|
||||
//Print the text otherwise.
|
||||
else
|
||||
{
|
||||
lcd->setCursor(0, 0);
|
||||
lcd->print(str);
|
||||
LOG_INFO("Printing [%s] on LCD");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user