diff --git a/esphome/components/logger/logger.cpp b/esphome/components/logger/logger.cpp index 29c5de05e9..bcd901daa1 100644 --- a/esphome/components/logger/logger.cpp +++ b/esphome/components/logger/logger.cpp @@ -49,8 +49,10 @@ void Logger::write_header_(int level, const char *tag, int line) { if (current_task == main_task_) { this->printf_to_buffer_("%s[%s][%s:%03u]: ", color, letter, tag, line); } else { -#if defined(USE_ESP32) || defined(USE_LIBRETINY) +#if defined(USE_ESP32) const char *thread_name = pcTaskGetName(current_task); +#elif defined(USE_LIBRETINY) + const char *thread_name = pcTaskGetTaskName(current_task); #elif defined(USE_ZEPHYR) const char *thread_name = k_thread_name_get(current_task); #else