ESPHome adds an optional startup log buffer so a device can explain an early failure after a log client connects. It preserves messages that appeared before Wi-Fi was ready, including when a shared or unavailable serial port leaves no other way to read them.
Makers choose the buffer size and can retain extra detail for a particular component. A replay action sends the stored lines to log listeners with their original time since startup. Capture stops at the first replay, and a warning reports any lines that did not fit.