Replaced Logger usage with LOG_x (#548)

This commit is contained in:
Ken Van Hoeylandt
2026-07-04 23:49:19 +02:00
committed by GitHub
parent ecad2248d9
commit 9d5993930d
162 changed files with 1776 additions and 1842 deletions
+12 -24
View File
@@ -1,7 +1,6 @@
#define LV_USE_PRIVATE_API 1 // For actual lv_obj_t declaration
#include <Tactility/LogMessages.h>
#include <Tactility/Logger.h>
#include <Tactility/PubSub.h>
#include <Tactility/RecursiveMutex.h>
#include <Tactility/Tactility.h>
@@ -13,6 +12,7 @@
#include <Tactility/settings/Time.h>
#include <tactility/check.h>
#include <tactility/log.h>
#include <tactility/lvgl_fonts.h>
#include <tactility/lvgl_module.h>
@@ -20,7 +20,7 @@
namespace tt::lvgl {
static const auto LOGGER = Logger("statusbar");
constexpr auto* TAG = "statusbar";
static void onUpdateTime();
@@ -62,9 +62,7 @@ static TickType_t getNextUpdateTime() {
time_t now = ::time(nullptr);
tm* tm_struct = localtime(&now);
uint32_t seconds_to_wait = 60U - tm_struct->tm_sec;
if (LOGGER.isLoggingDebug()) {
LOGGER.debug("Update in {} s", seconds_to_wait);
}
LOG_D(TAG, "Update in %d s", (int)seconds_to_wait);
return pdMS_TO_TICKS(seconds_to_wait * 1000U);
}
@@ -107,15 +105,13 @@ static lv_obj_class_t statusbar_class = {
};
static void statusbar_pubsub_event(Statusbar* statusbar) {
if (LOGGER.isLoggingDebug()) {
LOGGER.debug("Update event");
}
LOG_D(TAG, "Update event");
if (lock(defaultLockTime)) {
update_main(statusbar);
lv_obj_invalidate(&statusbar->obj);
unlock();
} else {
LOGGER.warn(LOG_MESSAGE_MUTEX_LOCK_FAILED_FMT, "Statusbar");
LOG_W(TAG, "Mutex acquisition timeout (%s)", "Statusbar");
}
}
@@ -247,9 +243,7 @@ int8_t statusbar_icon_add(const std::string& image, bool visible) {
statusbar_data.icons[i].visible = visible;
statusbar_data.icons[i].image = image;
result = i;
if (LOGGER.isLoggingDebug()) {
LOGGER.debug("id {}: added", i);
}
LOG_D(TAG, "id %d: added", (int)i);
break;
}
}
@@ -263,9 +257,7 @@ int8_t statusbar_icon_add() {
}
void statusbar_icon_remove(int8_t id) {
if (LOGGER.isLoggingDebug()) {
LOGGER.debug("id {}: remove", id);
}
LOG_D(TAG, "id %d: remove", (int)id);
check(id >= 0 && id < STATUSBAR_ICON_LIMIT);
statusbar_data.mutex.lock();
StatusbarIcon* icon = &statusbar_data.icons[id];
@@ -277,12 +269,10 @@ void statusbar_icon_remove(int8_t id) {
}
void statusbar_icon_set_image(int8_t id, const std::string& image) {
if (LOGGER.isLoggingDebug()) {
if (image.empty()) {
LOGGER.debug("id {}: set image (none)", id);
} else {
LOGGER.debug("id {}: set image {}", id, image);
}
if (image.empty()) {
LOG_D(TAG, "id %d: set image (none)", (int)id);
} else {
LOG_D(TAG, "id %d: set image %s", (int)id, image.c_str());
}
check(id >= 0 && id < STATUSBAR_ICON_LIMIT);
statusbar_data.mutex.lock();
@@ -294,9 +284,7 @@ void statusbar_icon_set_image(int8_t id, const std::string& image) {
}
void statusbar_icon_set_visibility(int8_t id, bool visible) {
if (LOGGER.isLoggingDebug()) {
LOGGER.debug("id {}: set visibility {}", id, visible);
}
LOG_D(TAG, "id %d: set visibility %d", (int)id, (int)visible);
check(id >= 0 && id < STATUSBAR_ICON_LIMIT);
statusbar_data.mutex.lock();
StatusbarIcon* icon = &statusbar_data.icons[id];