Skip to content

Commit

Permalink
Refactor logging statements to use a unified LOG function
Browse files Browse the repository at this point in the history
- Updated logging statements in various classes to use a common LOG function for consistency and easier maintenance.
  • Loading branch information
forntoh committed Oct 24, 2024
1 parent fb67332 commit 877f632
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/BaseItemManyWidgets.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class BaseItemManyWidgets : public MenuItem {
renderer->setEditMode(true);
draw(renderer);
renderer->drawBlinker();
printLog(F("ItemWidget::enterEditMode"), this->text);
LOG(F("ItemWidget::enterEditMode"), this->text);
return true;
}
return false;
Expand All @@ -140,13 +140,13 @@ class BaseItemManyWidgets : public MenuItem {
activeWidget--;
}
draw(renderer);
printLog(F("ItemWidget::left"), activeWidget);
LOG(F("ItemWidget::left"), activeWidget);
}

void right(MenuRenderer* renderer) {
activeWidget = (activeWidget + 1) % this->size;
draw(renderer);
printLog(F("ItemWidget::right"), activeWidget);
LOG(F("ItemWidget::right"), activeWidget);
}

void back(MenuRenderer* renderer) {
Expand All @@ -155,7 +155,7 @@ class BaseItemManyWidgets : public MenuItem {
handleCommit();
renderer->clearBlinker();
draw(renderer);
printLog(F("ItemWidget::exitEditMode"), this->text);
LOG(F("ItemWidget::exitEditMode"), this->text);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/BaseItemZeroWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class BaseItemZeroWidget : public MenuItem {
bool process(LcdMenu* menu, const unsigned char command) override {
if (command == ENTER) {
handleCommit(menu);
printLog(F("ItemWidget::enter"), text);
LOG(F("ItemWidget::enter"), text);
return true;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/widget/WidgetBool.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class WidgetBool : public BaseWidgetValue<bool> {
bool process(LcdMenu* menu, const unsigned char command) override {
if (command == ENTER) {
value = !value;
printLog(F("WidgetToggle::toggle"), value);
LOG(F("WidgetToggle::toggle"), value);
handleChange();
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/widget/WidgetCharset.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class WidgetCharset : public BaseWidgetValue<char> {
void updateValue(const __FlashStringHelper* action) {
value = charset[charsetPosition];
BaseWidgetValue<char>::handleChange();
printLog(action, value);
LOG(action, value);
}

bool backspace() {
Expand Down
4 changes: 2 additions & 2 deletions src/widget/WidgetRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class WidgetRange : public BaseWidgetValue<T> {
T newValue = (this->value + step > maxValue) ? (cycle ? minValue : maxValue) : (this->value + step);
if (newValue != this->value) {
this->value = newValue;
printLog(F("WidgetRange::increment"), this->value);
LOG(F("WidgetRange::increment"), this->value);
return true;
}
return false;
Expand All @@ -88,7 +88,7 @@ class WidgetRange : public BaseWidgetValue<T> {
T newValue = (this->value - step < minValue) ? (cycle ? maxValue : minValue) : (this->value - step);
if (newValue != this->value) {
this->value = newValue;
printLog(F("WidgetRange::decrement"), this->value);
LOG(F("WidgetRange::decrement"), this->value);
return true;
}
return false;
Expand Down

0 comments on commit 877f632

Please sign in to comment.