From da549601914034c5093ab307989eeca4e758d74e Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 26 Mar 2026 08:17:31 -1000 Subject: [PATCH] [logger] Warn when VERBOSE/VERY_VERBOSE logging is active Add a warning in dump_config() when the active log level is VERBOSE or VERY_VERBOSE to remind users these levels are intended for short-term debugging only. VERY_VERBOSE triggers an ESP_LOGW, VERBOSE triggers an ESP_LOGI. Both are guarded by compile-time #if/#elif so no code is added when compiled at a lower log level. --- esphome/components/logger/logger.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/esphome/components/logger/logger.cpp b/esphome/components/logger/logger.cpp index cd6543bfb8..8957ec6bad 100644 --- a/esphome/components/logger/logger.cpp +++ b/esphome/components/logger/logger.cpp @@ -244,6 +244,21 @@ void Logger::dump_config() { #ifdef USE_ZEPHYR dump_crash_(); #endif +#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 " + "connection instability. This level is intended for short-term debugging only. " + "Set the log level to DEBUG or lower for long-term use."); + } else if (this->current_level_ >= ESPHOME_LOG_LEVEL_VERBOSE) { + ESP_LOGI(TAG, "VERBOSE logging is active. This will impact device performance and is intended for short-term " + "debugging only. Set the log level to DEBUG or lower for long-term use."); + } +#elif ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE + if (this->current_level_ >= ESPHOME_LOG_LEVEL_VERBOSE) { + ESP_LOGI(TAG, "VERBOSE logging is active. This will impact device performance and is intended for short-term " + "debugging only. Set the log level to DEBUG or lower for long-term use."); + } +#endif } void Logger::set_log_level(uint8_t level) {