From d9261ae66dafc1cbdc5eaaf3b7aeabe1b453c15b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 4 Feb 2026 06:40:09 +0100 Subject: [PATCH] tweak --- esphome/components/logger/logger.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/esphome/components/logger/logger.h b/esphome/components/logger/logger.h index c0a807c991..984b626733 100644 --- a/esphome/components/logger/logger.h +++ b/esphome/components/logger/logger.h @@ -473,10 +473,13 @@ class Logger : public Component { FormatType format, va_list args) { RecursionGuard guard(recursion_guard); LogBuffer buf(this->tx_buffer_, this->tx_buffer_at_, this->tx_buffer_size_); - if constexpr (std::is_same_v) { - this->format_log_to_buffer_with_terminator_(level, tag, line, format, args, buf); - } else { +#ifdef USE_STORE_LOG_STR_IN_FLASH + if constexpr (std::is_same_v) { this->format_log_to_buffer_with_terminator_P_(level, tag, line, format, args, buf); + } else +#endif + { + this->format_log_to_buffer_with_terminator_(level, tag, line, format, args, buf); } this->notify_listeners_(level, tag); this->write_log_buffer_to_console_(buf);