From 8677dafae8df0e477d358560f42dc6f4397a941b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 26 Mar 2026 08:27:00 -1000 Subject: [PATCH] [logger] Add comment explaining why compiled log level matters --- esphome/components/logger/logger.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/esphome/components/logger/logger.cpp b/esphome/components/logger/logger.cpp index 8957ec6bad..f6159277b0 100644 --- a/esphome/components/logger/logger.cpp +++ b/esphome/components/logger/logger.cpp @@ -244,6 +244,10 @@ void Logger::dump_config() { #ifdef USE_ZEPHYR dump_crash_(); #endif + // Warn users that VERBOSE/VERY_VERBOSE logging impacts performance. + // The compiled log level (ESPHOME_LOG_LEVEL) is what matters here — even if + // initial_level is set lower at runtime, log messages at the compiled level + // are still formatted (vsnprintf) and written to UART which is blocking. #if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERY_VERBOSE if (this->current_level_ >= ESPHOME_LOG_LEVEL_VERY_VERBOSE) { ESP_LOGW(TAG, "VERY_VERBOSE logging is active. This will significantly impact device performance and may cause "