[logger] Warn when VERBOSE/VERY_VERBOSE logging is active (#15189)

This commit is contained in:
J. Nick Koston
2026-03-26 15:59:58 -10:00
committed by GitHub
parent e77cdb5971
commit 90dafa3fa4
+10
View File
@@ -243,6 +243,16 @@ void Logger::dump_config() {
#endif
#ifdef USE_ZEPHYR
dump_crash_();
#endif
// Warn users that VERBOSE/VERY_VERBOSE logging impacts performance.
// Only the compiled log level matters — all log calls up to this level
// are in the binary and will be formatted (vsnprintf) and block UART.
#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERY_VERBOSE
ESP_LOGW(TAG, "VERY_VERBOSE logging is active — significant performance impact, short-term debugging only\n"
" May cause connection instability. Set log level to DEBUG or lower for long-term use.");
#elif ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE
ESP_LOGI(TAG, "VERBOSE logging is active — performance impact, short-term debugging only\n"
" Set log level to DEBUG or lower for long-term use.");
#endif
}