5#ifdef USE_LIBRETINY_CRASH_HANDLER
15 switch (this->
uart_) {
41 ESP_LOGW(TAG,
" The chosen logger UART port is not available on this board."
42 "The default port was used instead.");
50 lt_log_set_port(LT_UART_DEFAULT_SERIAL);
52 lt_log_set_port(this->
uart_ - 1);
57 ESP_LOGI(TAG,
"Log initialized");
58#ifdef USE_LIBRETINY_CRASH_HANDLER
64 switch (this->
uart_) {
66 return LOG_STR(
"DEFAULT");
68 return LOG_STR(
"UART0");
70 return LOG_STR(
"UART1");
73 return LOG_STR(
"UART2");
77#ifdef USE_LIBRETINY_CRASH_HANDLER
const LogString * get_uart_selection_()
void pre_setup()
Set up this component.
void crash_handler_log()
Log crash data if a crash was detected on previous boot.
void ensure_serial_handle(uint8_t port)
Give a hardware UART its SDK handle before its Serial begin()s.
bool crash_handler_has_data()
Returns true if crash data was found this boot, reading it first if needed.
bool crash_log_pending()
Whether a crash record from before this boot is waiting to be reported.
UARTSelection
Enum for logging UART selection.
void log_crash_to_client()
Log the previous crash for a client that just subscribed to the logs.
ESPHOME_LOG_TAG(TAG, "logger")